Quick Forms Review Forms One of the main

  • Slides: 5
Download presentation
Quick Forms Review

Quick Forms Review

Forms �One of the main ways to get data to a server side application

Forms �One of the main ways to get data to a server side application �Not the only way � Anchors with "get" data � & with name=value pairs in URL � Cookies � Can be generated on the client and server � Sessions � Controlled by server

Forms � Each form should gather a related set of information � Text �

Forms � Each form should gather a related set of information � Text � � Text box Text area � Mutually exclusive options � Radio buttons � Can have multiple groups � Multiple choice options � Check boxes � Can group check boxes � Drop downs � Very flexible � � Show only one � Expanded by drop-down Show a window Force single choice Allow multiple items to be chosen � Hidden � Keep information not shown on Web page

Forms �Each may have its own action � Code to be retrieved on server

Forms �Each may have its own action � Code to be retrieved on server � action="server_program. ext" � Web server knows what to do with various types of code � Usually triggered by a submit button � type="submit" � May be triggered by a script �Each form should be checked before submitted � Usually done by a script � onsubmit="script_function()" � Check the contents of each data element � Correct data type � Correct range � Proper elements filled out

Forms �Can put as many as you want on a Web page �Each form

Forms �Can put as many as you want on a Web page �Each form should contain a related set of data �Only one form may be submitted �Each form can have its own "action" �Use restraint in the number of forms �One or two are usually enough �Occasionally 5, 10, or more forms may be useful � These are rare � Justify the use