newtomysql — 2011-07-27T12:42:21-04:00 — #1
I have a link here http://18.104.22.168/v3/addCVC.php. First if you select the name T1 via ajax the second drop down list is populated. Then pick anyvalue from the second drop down list and your will get a table populated below it. Then finally when you press submit button I call the validation function. In there I got this little codes.The alert keep showing me null even though the table is generated with its relevant values too. What is the problem ya?
var table = document.getElementById("listOfCorrection");
//var checkbox = table.getElementsByTagName("input");
overthemike — 2011-07-27T12:47:06-04:00 — #2
Does the table exist in the DOM when you make that call? It looks like when you click the submit button (which is when you get that alert), you're deleting the table from the DOM which would in turn give you null...
newtomysql — 2011-07-27T12:48:33-04:00 — #3
I check via the firebug in firefox yes the table is shown to me. So how to make sure the table is not deleted?
newtomysql — 2011-07-27T20:02:31-04:00 — #4
Here is my page http://22.214.171.124/v3/addCVC.php. First your select T1 from the first drop down list then the second drop down list will be populated then from the second drop down list you can select any value and you will get a table. This talble is where I reference in the validation function. Thank you.
paul_wilkins — 2011-07-27T20:11:11-04:00 — #5
The reason why you are getting null is because that section of the page no longer exists, so that is no longer any element with the id that you are looking for.
Why does is no longer exist? It's due to this assignment which removes the content:
newtomysql — 2011-07-27T20:15:54-04:00 — #6
Thanks that helped.