L
LaughOutLoud
Hi. I wonder is it possible to grab everything in a form by calling one
javascript function and turns it into array or object?
E.g.
<form id="form1" name="form1" method="post" action="">
<input name="fname" type="text" id="fname" />
<input name="lname" type="text" id="lname" />
<input name="email" type="text" id="email" />
</form>
I only know that using getElementById three times in order to grab the
value of the form and assign it in to variables or associative array
email = document.getElementById('email').value;
fname = document.getElementById('fname').value;
lname = document.getElementById('lname').value;
Is there any javascript or functions that just call the form name or
div id into javascript variable or turn it to array?
Thanks
javascript function and turns it into array or object?
E.g.
<form id="form1" name="form1" method="post" action="">
<input name="fname" type="text" id="fname" />
<input name="lname" type="text" id="lname" />
<input name="email" type="text" id="email" />
</form>
I only know that using getElementById three times in order to grab the
value of the form and assign it in to variables or associative array
email = document.getElementById('email').value;
fname = document.getElementById('fname').value;
lname = document.getElementById('lname').value;
Is there any javascript or functions that just call the form name or
div id into javascript variable or turn it to array?
Thanks