• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. Using JavaScript and ColdFus... > Working with Form Elements

Working with Form Elements

Every Web page containing forms exposes a document.forms collection, which is an array of forms on the page. Each <form> block in the page can be therefore referred to by number, where document.forms[0] refers to the first <form> block on the page, document.forms[1] refers to the second form, and so on. The number of forms is always available as document.forms.length.

If a <form> tag includes a name attribute, you can also refer to it by name as a property of the document object. So, if a page includes a single form that has a name="SignupForm" attribute, you can refer to the form as either document.forms[0] or document.SignupForm.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint