534 Part III . Document Objects Reference Many (Web hosts)

534 Part III . Document Objects Reference Many ISPs that host Web sites provide standard CGIs for forwarding forms to an e-mail address of your choice. This manner of capturing form data, however, does not also capture the visitor s e-mail address unless your form has a field where the visitor voluntarily enters that information. Note Under no circumstances is a form submitted via the mailto: URL a secure document. The form data is embedded within a plain e-mail message that goes through the same Internet routes and servers as any e-mail message. The remaining discussion about mailing forms focuses primarily on NN2+ and IE5+ browsers. You should be aware that mailing forms in the following ways is controversial in some Web standards circles. As of this writing, the W3C HTML specification does not endorse these techniques specifically. However, the latest browsers do support them nonetheless. Use these facilities judiciously and only after extensive testing on the client browsers you intend to support. If you want to have forms submitted as e-mail messages, you must attend to three

tag attributes. The first is the METHODattribute. You must set it to POST. Next comes ENCTYPE. If you omit this attribute, the e-mail client sends the form data as an attachment consisting of escaped name-value pairs, as in this example: name=Danny+Goodman&rank=Scripter+First+Class&serialNumber=042 But if you set the ENCTYPE attribute to text/plain, the form name-value pairs are placed in the body of the mail message in a more human-readable format: name=Danny Goodman rank=Scripter First Class serialNumber=042 The last attribute of note is the ACTION attribute, which is normally the spot to place a URL to another file or server CGI. Substitute the URL with the special mailto:URL followed by an optional parameter for the subject. Here is an example: ACTION= mailto:prez@whitehouse.gov?subject=Opinion%20Poll To sum up, the following example shows the complete tag for e-mailing the form in Navigator. None of this requires any JavaScript at all. But seeing how you can use the attributes and the fact that these attributes are exposed as properties of the FORM element object you might see some extended possibilities for script control over forms. Changing form attributes With the exception of IE3 (whose FORM object properties are read-only), all scriptable browsers expose FORM element attributes as modifiable properties. Therefore, you can change, say, the action of a form via a script in response to user interaction on your page. For example, you can have two different CGI programs invoked on your server depending on whether a form s checkbox is checked. FORM
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply