Get form element infomation : Form Info : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Form Info »

 

Get form element infomation



<html>
<head>
<script language="JavaScript">
<!--
function showElements(f) {
  var formElements = "";
  for (var n=0; n < f.elements.length; n++) {
      formElements += n + ":" + f.elements[n"n";
  }
  alert("The elements in the form '" + f.name + "' are:nn" + formElements);
}
//-->
</script>
</head>
<body>
<form name="ExampleForm">
<table border=0>
<tr>
 <td>
  <input name="cb1" type="checkbox" checked>Option 1<br>
  <input name="cb2" type="checkbox">Option 2
 </td>
</tr>
<tr>
<td>Name:</td>
<td><input type="text" size=45 name="fullname"></td>
</tr>
<tr>
 <td>Address:</td>
 <td><textarea name="ta"></textarea></td>
</tr>
<tr>
 <td>
  <input type="button" value="See elements" onClick="showElements(this.form)">
 </td>
</tr>
</form>
</table>
</body>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Form Info