I'm trying to setup a validator, however i've run into an issue. When I reference formObject.name, I would expect to return the name of that form (<form name="myForm">).
Well, this isn't the case when you have an input field with the name of "name" (<input name="name"). In this case, it returns the InputElement inside the formObject.
To work around this issue, I went with formObject.getAttribute('name'). This worked fine with Firefox, however IE is still returning the HTMLInputElement "name". Is there a better/different way to get the name of an HTML form. Here's the process I'm using:
Thanks!
Well, this isn't the case when you have an input field with the name of "name" (<input name="name"). In this case, it returns the InputElement inside the formObject.
To work around this issue, I went with formObject.getAttribute('name'). This worked fine with Firefox, however IE is still returning the HTMLInputElement "name". Is there a better/different way to get the name of an HTML form. Here's the process I'm using:
Code:
forms = document.getElementsByTagName('form');
for(var i=0; i < forms.length; i++){
form_name = forms[i].getAttribute('name');
}
Thanks!