Form.length : Form Object : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Form Object »

 

Form.length








The length property represents the number of elements within a form.

This property works the same as the elements.length property.












<html>
    <head>
    <title> Using the length property of the Form object</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function showNumElements(){
         alert("There are " + document.form1.length + " elements in this document");
    }
    -->
    </script>
    <form name="form1">
    Enter First Name:
    <input type="text" size=15><br>
    Enter Last Name:
    <input type="text" size=20><br>
    Enter address:
    <input type="text" size=40><br><br>
    <input type="button" value="Submit" onClick=showNumElements()>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Form Object