Forms and FormElementsMost interactivity between a Web page (Top web site)

Forms and FormElementsMost interactivity between a Web page and the user takes placeinside a form. That s where a lot of the interactive HTML stufflives for every browser: text fields, buttons, checkboxes, option lists, and so on. As described in earlier chapters, you may use the modern DOMdocument.getElementById()method to reference any element, including forms and form controls. But this chapter focuses on anolder, yet equally valid way of referencing forms and controls. It simportant to be familiar with this widely used syntax so that you canunderstand existing JavaScript source code written according to theoriginal (and fully backward-compatible) form syntax the so-calledDOM Level 0 syntax. The form ObjectUsing the original DOM Level 0 syntax, you can reference a formobject either by its position in the array of forms contained by a doc- ument or by name (if you assign an identifier to the nameattributeinside the

tag). If only one form appears in the document, it isstill a member of an array (a one-element array) and is referenced asfollows: document.forms[0] Or use the string of the element s name as the array index: document.forms[formName] Notice that the array reference uses the plural version of the word, followed by a set of square brackets containing the index number(zero is always first) or name of the element. Alternatively, you canuse the form s name (not as a quoted string) as if it were a propertyof the documentobject: document.formName99CHAPTER …In This ChapterWhat the formobjectrepresentsHow to access keyformobject propertiesand methodsHow text, button, andselectobjects workHow to submit formsfrom a scriptHow to passinformation from formelements to functions …
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Leave a Reply