dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: finding out the number of elements in a form

  1. #1
    Join Date
    Jan 2007
    Posts
    8

    finding out the number of elements in a form

    Does anyone know if there is a good way to find out the number of elements in a form?

    For example, if I had the following form:

    <FORM NAME=TEMP>
    <INPUT>
    <INPUT>
    <INPUT>
    <INPUT>
    </FORM>

    is there a way to set up a variable that would be

    var numElements = 4;

    for this simple form?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    var numElements = document.forms['temp'].elements.length;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles