David Lash DePaul University SNL 262 Web Page Design Forms! - Chapt 7 Instructor: David A. Lash
David Lash 2 HTML Forms zHTML Forms are used to: yGather survey information on web ySubmit passwords yStructure queries on a database ySubmit orders yClick Here for an examplean example yhttp:// amples/08survey.htm
David Lash 3 HTML Forms zWhen submit a form it will be sent to a server script for processing HTML Form Submit Program or database on Webserver (e.g., condor)
David Lash 4 HTML Form Elements Text Box Radio Buttons Check Box Select Box Text Area Submit/Reset button
David Lash 5 Starting and Ending Forms HTML forms are created by using the HTML and tags. y Within these tags, you place various HTML form elements, such as text areas, check boxes, and radio buttons. y For example, y.. ---(Your FORM elements here).
David Lash 6 Two primary arguments z<FORM ACTION=” METHOD=”POST”> – get appends the form arguments to the end of the Web address. – post sends the data as part of the body of the HTML document. – Will use post since get method may limit the amount of data you can send. ACTION= - Specifies the URL of the receiving file/program to start when the form is submitted METHOD= - Defines the argument format that will be used to send data to the receiving program/file.
David Lash 7 Some Form Tag Examples Sends the results to a program at Sends the results to via to yThe you get is a messy (Click here for example.) For that reason, most sites don’t submit directly but execute a program first.Click here for example
David Lash 8 The Big Picture For Forms Your Form Here (Checklists, Text Boxes, Drop-down lists, buttons, etc)
David Lash 9 Creating Text Boxes zText boxes are those input areas on a form where the customer can input free-format typing. For example click here.For example click here.
David Lash 10 Text Box: Format Please Enter Your Full Name Where yPlease Enter Your Full Name - is text to display immediately before the text box. yInput Type - A keyword that says how input will come in. You can say x"Text" - for text boxes with characters displayed in box as typed. x"Passwd" - For text boxes with asterisks "*" displayed in box as typed. ySIZE= Width of (in chars) the input box. yMAXLENGTH= - The max number of characters the user can type into box. y Name= The name identifier passed to the program. (E.g., name="David Lash" )
David Lash 11 Text Box: Format Please Enter Your Full Name Where y Name= The name identifier passed to the program. (E.g., name="David Lash" ) The resulting might look like: fullname=Dave+Lash
David Lash 12 Text Area: Format Just like text box but bigger. Click hereClick here <textarea NAME="UNIT_COMMENTS" ROWS=4 COLS=70 >Your comments here zName= The name identifier passed to the program. (E.g., name=”UNIT_COMMENTS”) zROWS, COLS = Number of cols and rows of text box
David Lash 13 Check Boxes Check boxes are pre-defined optional input that you check. Click Here for example
David Lash 14 Check Boxes: General Format Pick your favorite: Baseball Hockey Soccer Click Here for what it looks like: Pick your favorite: - This is a string of characters the shows up before check box. input TYPE="checkbox" - Says create a checkbox within the form. NAME=“soccer" - a name (e.g., soccer) to the checkbox that will be passed to the software. VALUE=“Like soccer" - Specifies the initial value of the control (all set to “like soccer”) Note: you can include a checked attribute that checks the box initially.
David Lash 15 Radio Buttons: General Format zRadio Boxes - (just like checked boxes - click here) click here) How is Web Site Design Going : I get my extra sleep in class. I get so confused I get lost trying to find my car after class. I gave up and copy my answers from my neighbor. Great class can't wait for the movie. Specifies to create a radio button Logical name is “variable1” Variable1 is “set” to “great” if this item is picked
David Lash 16 Selection Lists Here is an example zUse tag to create scrolling and pull-down pick lists. Electric windows AM/FM Radio Turbo Charger z name = the label shown from the mail. zsize =number of selections shown zmultiple = allow multiple options to pick zoption = the option to pick zoptions selected = pre-selected option.
David Lash 17 Submit Buttons zSubmit - (send it on down - click here)click here zCan also reset Create a submit button Put this text on the button. Use this gif image for button.
David Lash 18 Putting it all together Survey Form Class Survey Name: Class: Class Evaluation: Great Average Fair Poor Comments:
David Lash 19 Putting it all together Class Survey Name: Class Class Evaluation: Great Average Fair Poor Comments
David Lash 20 In Summary zWe spoke about yWhat are forms? yThe Form tag and arguments yHow to create xRadio buttons xChecklists xSelection lists xText boxes xText areas xSubmit buttons yHow to format it all nicely.
David Lash 21 Before We Leave zHomework ReviewHomework Review zTest Review