Getting input field values without using its ID
by guruprasad[ Edit ] 2014-03-17 11:01:38
To get values of all input fields :
var form=document.getElementById(formID);
inputField = form.getElementsByTagName('input');
for (i = 0; i < inputField.length; i++)
{
alert(inputField[i].value); //retrieving field values.
}
Useful in validating the form without using its ID.