Getting input field values without using its ID

by guruprasad 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.
1547
like
0
dislike
0
mail
flag

You must LOGIN to add comments