1 / 24

Forms for the Web

Forms for the Web. Tom Muck www.dwteam.com. Introduction. Forms are a way to pass name/value pairs to the server Forms can be built in HTML or Flash Concept is the same – execution is different. What makes a great form?. Make it easy for the user Get the information once

bettyv
Download Presentation

Forms for the Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Forms for the Web Tom Muck www.dwteam.com www.dwteam.com

  2. Introduction • Forms are a way to pass name/value pairs to the server • Forms can be built in HTML or Flash • Concept is the same – execution is different www.dwteam.com

  3. What makes a great form? • Make it easy for the user • Get the information once • Move the user through the site quickly • Get the information accurately • End the experience www.dwteam.com

  4. The HTTP Protocol • Stateless environment • Cookies • Sessions www.dwteam.com

  5. Web Servers/Application Servers • What’s the difference? • How it fits together • Adding a Database tier Text Text Text Text Text Text Text Text Text www.dwteam.com

  6. HTML or Flash forms • Similar concept and execution • Which do you use? www.dwteam.com

  7. Beginning with HTML Forms • Form tag in HTML • 2 necessary elements • Method (get or post) • Action (page) www.dwteam.com

  8. Methods -- GET • Uses the query string • Standard text/html MIME header (enctype) • Not as secure as Post • Limited to a specific length, depending on browser. (between 1000-2000 characters) • Can be bookmarked and indexed • Can be manipulated by the user www.dwteam.com

  9. Methods -- POST • More secure • application/x-www-form-urlencoded MIME header (default enctype) • Can’t be altered easily • Not limited in length like GET • Cannot be bookmarked or indexed • Can be submitted again and again by an impatient user www.dwteam.com

  10. Action • Can be the same page or a different page • On the same page -- the way Dreamweaver MX code operates • On a different page in a “classic” two-page approach • Can also be made variable, or hold a special value www.dwteam.com

  11. The Dreamweaver environment • Creating a form • Form elements • Other HTML elements • Adding a table to hold the form • Adding images as submit buttons www.dwteam.com

  12. Validation • Client side • Server side • Database level www.dwteam.com

  13. Client-side Validation • Advantages • User-friendly • Avoids unnecessary server processing • Easily programmed with JavaScript • Easily added to Dreamweaver pages with Behaviors www.dwteam.com

  14. Client-side Validation • Disadvantages • Can be disabled by paranoid user • Can be disabled by malicious user • NOT 100% reliable solution • Good for the 1st wave of attack. Eliminate 90% of the bad data. www.dwteam.com

  15. Server-side Validation • Advantages • Can’t be disabled by the user • Can’t be seen by the user • Easily programmed with server-side code • Easily added to Dreamweaver pages with third party Server Behaviors www.dwteam.com

  16. Server-side Validation • Disadvantages • Requires a trip to the server • Eats up server processing time • Requires good knowledge of server-side coding • Use for 2nd wave of attack www.dwteam.com

  17. At the Database Level • Advantages • Last stop for data -- catch bad data before it goes in • Quick and efficient • Coded directly into the database schema www.dwteam.com

  18. At the Database Level • Disadvantages • Needs server-side logic to handle errors • Not easily coded by the Web programmer • Use for the 3rd and final wave of attack www.dwteam.com

  19. Displaying Server-side content in Form Fields • Use the appropriate server-side or client-side constructs • Form data • Cookie data • Database content • Use the Bindings panel – underused panel in Dreamweaver • “Bind” form elements to data www.dwteam.com

  20. Bindings Panel • Use the Bindings panel – underused panel in Dreamweaver • “Bind” form elements to data www.dwteam.com

  21. Flash Forms • Same protocols as HTML -- get and post • Same logic • User fills in form fields • Validate the fields • Submit the form • Process on the server • Return any results www.dwteam.com

  22. Flash Forms -- Validation • Validation routines built in ActionScript • Better than JavaScript -- can’t be turned off • Numerous JavaScript examples can be adapted easily • No built-in validations www.dwteam.com

  23. Summary • HTML and Flash: different ways to accomplish the same thing • Different methods of validation: no “best” way. • Q & A www.dwteam.com

  24. Where to Get More Information • www.dwteam.com • www.macromedia.com/desdev • www.dwfaq.com • www.macromedia.com/extensions • Dreamweaver MX: The Complete Reference, by Ray West and Tom Muck www.dwteam.com

More Related