Table generated but not seen via validation

Dear All,
I have a link here 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");

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…

Dear Mike,
I check via the firebug in firefox yes the table is shown to me. So how to make sure the table is not deleted?

Dear Paul,
Here is my page 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.

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:


Dear Paul,
Thanks that helped.