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

11. Forms > 11.4. Validating Forms

Validating Forms

It can be frustrating to look over feedback that’s been submitted via a form on your Web page, only to notice that your visitor failed to provide a name, email address, or some other piece of critical information. That’s why, depending on the type of form, you might want to make certain information mandatory.

For instance, a form used for subscribing to an email newsletter isn’t much use if the would-be reader doesn’t type in an email address for receiving it. Likewise, if you need a shipping address to deliver a brochure or product, you’ll want to be sure that the visitor included her address on the form.

Luckily, Dreamweaver provides a Behavior—a ready-made JavaScript program—that accomplishes this exact task. Called Validate Form, this Dreamweaver behavior alerts visitors when they haven’t filled out a form properly. You can specify that a particular field can’t be left blank, or that it must contain numbers only, or that it must contain a proper email address. If someone attempts to submit the form without the correct information, a small dialog box pops up identifying the mistake. No more blank forms!


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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