Web hosting domains - 529Chapter 23 .The Form and Related Objects does

529Chapter 23 .The Form and Related Objects does with this information depends on the CGI (Common Gateway Interface) programs running on the server. If your Web site runs on a server directly under your control (that is, it is in-house or hosted by a service), you have the freedom to set up all kinds of data-gathering or database search programs to interact with the user. But with some of the more consumer-oriented Internet Service Providers (ISPs), you may have no CGI support available or, at best, a limited set of popular but inflexible CGI programs available to all customers of the service. Custom databases or transactional services are rarely provided for this kind of Internet service. Regardless of your Internet server status, you can find plenty of uses for JavaScript scripts in forms. For instance, rather than using data exchanges (and Internet bandwidth) to gather raw user input and report any errors, a JavaScriptenhanced document can preprocess the information to make sure that it employs the format that your back-end database or other programs most easily process. All corrective interaction takes place in the browser, without one extra bit flowing across the Net. I devote all of Chapter 43 to these kinds of form data-validation techniques. How you define a FORM element (independent of the user interface elements described in subsequent chapters) depends a great deal on how you plan to use the information from the form s controls. If you intend to use the form completely for JavaScript purposes (that is, no queries or postings going to the server), you do not need to use the ACTION, TARGET, and METHODattributes. But if your Web page will be feeding information or queries back to a server, you need to specify at least the ACTIONand METHOD attributes. You need to also specify the TARGET attribute if the resulting data from the server is to be displayed in a window other than the calling window and the ENCTYPE attribute if your form s scripts fashion the server-bound data in a MIME type other than in a plain ASCII stream. References to form control elements For most client-side scripting, user interaction comes from the elements within a form; the FORM element object is merely a container for the various control elements. If your scripts perform any data validation checks on user entries prior to submission or other calculations, many statements have the form object as part of the reference to the element. A complex HTML document can have multiple FORM objects. Each

tag pair defines one form. You don t receive any penalties (except for potential confusion on the part of someone reading your script) if you reuse a name for an element in each of a document s forms. For example, if each of three forms has a grouping of radio buttons with the name choice, the object reference to each button ensures that JavaScript doesn t confuse them. The reference to the first button of each of those button groups is as follows: document.forms[0].choice[0] document.forms[1].choice[0] document.forms[2].choice[0] Remember, too, that you can create forms (or any HTML object for that matter) on the fly when you assemble HTML strings for writing into other windows or frames. Therefore, you can determine various attributes of a form from settings in an existing document. FORM
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply