Count forms in a document : JavaScript DHTML examples (example source code) » Form Control » Form Info

JavaScript DHTML
C++
Java Products
Java Articles
JavaScript DHTML Home  »   Form Control   » [  Form Info  ]   
 



Count forms in a document

Please note that some example is only working under IE or Firefox.

<html>

<body>
    <form name="Form1">
        Name: <input type="text" size="20">
    </form>
    <form name="Form2">
        Age: <input type="text" size="3">
    </form>

<script type="text/javascript">

    txt="This document contains: " + document.forms.length + " forms."
    document.write(txt)

</script>

</body>

</html>
Related examples in the same category
1.  Formats, verifies and recover the contents of HTML forms
2.  Access an item in a collection
3.  Get form element infomation








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.