Hello!
I'm writing a form validation script that's supposed to iterate through each of the fields in a form and look for tags that contain a custom attribute called validation_style.
A sample tag looks something like:
<input name="population" type="text" validation_style="numeric">
My javascript looks like this:
for(y=0; y < the_form.elements.length; y++)
{
form_element = the_form.elements[y];
validation_style = form_element.getAttribute("validation_style");
alert(validation_style); // should eventually print out numeric
}
This works great in IE, but not in Firefox nor in Opera. I *think* that the getAttribute() call isn't finding my custom attribute, but I'm no expert.
Thanks!
- Bret
I'm writing a form validation script that's supposed to iterate through each of the fields in a form and look for tags that contain a custom attribute called validation_style.
A sample tag looks something like:
<input name="population" type="text" validation_style="numeric">
My javascript looks like this:
for(y=0; y < the_form.elements.length; y++)
{
form_element = the_form.elements[y];
validation_style = form_element.getAttribute("validation_style");
alert(validation_style); // should eventually print out numeric
}
This works great in IE, but not in Firefox nor in Opera. I *think* that the getAttribute() call isn't finding my custom attribute, but I'm no expert.
Thanks!
- Bret