Kevin Murphy Creating Forms Masters Project CS 490
Kevin Murphy HTML Tags
Kevin Murphy Attributes n required attributes - ACTION= “script.url”—location on server of CGI script “mailto:( address)” - METHOD= “GET”—Data added at end of URL, sent as variable “POST”—Data is sent separately to server (This is what we will use.)
Kevin Murphy Sample of Opening Form Tag n (Spaces are shown for ease of viewing only.)
Kevin Murphy User Input Fields n These define the elements that will appear on the form that the user will interact with. n This is the same concept as a database or a mail merge field. n The elements are defined using the tag. n Regular, explanatory text can be inter- spersed with on the form.
Kevin Murphy The Tag TYPE = Attribute n The TYPE= attribute specifies the type of input. Options are: TEXT PASSWORD RADIO CHECKBOX SUBMIT RESET
Kevin Murphy Other Tag Attributes n SIZE - Defines the size of text input box on form in # of characters—default is 20 n NAME - Gives the text input box a data element name that identifies the information n CHECKED - For marking radio button/checkbox by default n READONLY - To keep visitors from changing form elements
Kevin Murphy Sample Response Form Customer Name:
Kevin Murphy Sample Response Form Customer Name: City: DesPlaines Skokie (Sample continued)
Kevin Murphy Response Form Customer Name: City: Des Plaines Skokie Result
Kevin Murphy List Boxes Using the SELECT tag and OPTION attribute, a list box can be created. Dog/s Cat/s Bird/s Other/s
Kevin Murphy Sample Cont’d Please send information. What types of pets do you have? (Select all that apply) Dog/s Cat/s Bird/s Other/s (Sample continued)
Kevin Murphy Response Form Customer Name: City: Des Plaines Skokie Please send information What types of pets do you have? (Select all that apply) Dog/s Result
Kevin Murphy Finally... SUBMIT The standard way for a user to send form info to the server is clicking a submit button RESET This button resets all the form’s default settings
Kevin Murphy Sample Cont’d
Kevin Murphy Response Form Customer Name: City: Des Plaines Skokie Please send information What types of pets do you have? (Select all that apply) Dog/s Send Data Clear K. Tabers
Kevin Murphy HTML Tags Review