S
syntheticninja
I am trying to loop through a form to get all the check boxes that
exist on that particular form. My problem is the checkboxes are
dynamically added to the page after it has loaded (using the innerHTML
of a div).
When I do this, I get back that there are no elements on the form.
This is how I try to loop through the form.
function getChecked(oForm) {
var el, i = 0;
while (el = oForm.elements[i++]) if (el.type == 'checkbox') //do stuff
}
If I access the information included with the innerHTML by itself, it
works fine. Ont the page where it gets placed, it cannot be found.
exist on that particular form. My problem is the checkboxes are
dynamically added to the page after it has loaded (using the innerHTML
of a div).
When I do this, I get back that there are no elements on the form.
This is how I try to loop through the form.
function getChecked(oForm) {
var el, i = 0;
while (el = oForm.elements[i++]) if (el.type == 'checkbox') //do stuff
}
If I access the information included with the innerHTML by itself, it
works fine. Ont the page where it gets placed, it cannot be found.