COS 125 DAY 26. Agenda Assignment #7 Graded 10 A’s, 4 B’s, and 1 non-submit Assignment # 8 Due April 27 Assignment #9 will be assigned in WebCT by Tuesday.
Published byModified over 5 years ago
Presentation on theme: "COS 125 DAY 26. Agenda Assignment #7 Graded 10 A’s, 4 B’s, and 1 non-submit Assignment # 8 Due April 27 Assignment #9 will be assigned in WebCT by Tuesday."— Presentation transcript:
Agenda Assignment #7 Graded 10 A’s, 4 B’s, and 1 non-submit Assignment # 8 Due April 27 Assignment #9 will be assigned in WebCT by Tuesday Last one!!!! Due May 4, 8AM Exam #5 is April 30 Castro Chap13, 14, 15 & 16 25 M/C questions, WebCT 50 min Capstones Projects Everything due MAY 4 8AM Presentations at that time also Website for text book http://www.cookwood.com/html5ed/http://www.cookwood.com/html5ed/ Website for examples http://perleybrook.umfk.maine.edu/samples/sample.htm http://perleybrook.umfk.maine.edu/samples/sample.htm Lecture/Discuss Forms
Learning Objectives What are forms?? Understand how to create an xHTML form Understand that most forms require a CGI script Understand how to submit a form by e-mail without a CGI script Be aware of form hosting services as a alternative way to process forms Use form fieldset elements Use form label elements Use tabindex and accesskey attributes to improves a form’s accessibility Understand how to disable form elements Understand how to display form contents in a way that cannot be changed
What is a form?? A form is a way to actively collect or display information to or from a web site viewer What can you do with forms? Get feedback Have a guestbook Take a survey See who’s visiting you Sell stuff And much more!
What do Scripts do Elements in forms Collect data Name Values pairs Display data Name values Perform actions Buttons Scripts Do something with data collected Format data for display Add functionality to action elements
Getting a Script First ok use of scripts with web server administrator Search web for free (or near free scripts) www.cpan.org www.cpan.org www.cgi-resources.com www.cgi-resources.com www.extropia.com www.extropia.com www.awsd.com/scripts www.awsd.com/scripts
Creating A Form A form has 3 important parts The form The script that process the form The form elements Text boxes Buttons Menus Example Stuff
Sending From Data via E-mail If you don’t want to use scripts you can have form data sent to you via e-mail mailto:firstname.lastname@example.org … form elements…
Using a Form Hosting Service An option to creating scripts is using a form hosting service Steps Find a hosting service Connect to hosting service Read the site info Follow their instructions
Creating text boxes Text boxes contain one line of free-form text Provide prompt to the users “Type your comments in the area provided.” Value is default text that will appear in text box Size is the display area in number of characters Maxlength is maximum number of characters the text box will accept Usually size < maxlenght
Creating Password box The difference between a text box and a password box is that the user will not see what they are typing. The characters are replaced with ** Give the user a prompt Enter password:
Creating Radio Buttons Radio Buttons allow you to select only one possible response from a list The following creates a list of 3 choices with the third choice already selected. Choice A Choice B Choice C
Creating Checkboxes Checkboxes allow you to select as many responses as you like from a list The following creates a list of 3 choices with the third choice already selected. Choice A Choice B Choice C
Prompt the user “Select one of the list:” The following creates a drop down of N lines with 3 choices. Menu 3 is preselected. Menu 1 Menu 2 Menu 3
To Create Grouped menus Create a menu as described on previous slide Before the 1 st option tag in the 1 st group … After the last option you wish to group
Creating a Larger Text Area Gives user more room to write than text box Prompt the user “Enter comments here:” Default Text Can accepted up to 32,700 characters Scroll bars appear when user types in more text than visible area
Requires a special CGI script What files are you sending?
Hidden Fields The data is embedded in form and users doesn’t see and can’t modify Must give a value Data will be passed to script
Creating the Submit Button When depressed will send all name value pairs to script The text given for value will appear on the button You can use many submit buttons if you name them You can add an image to a submit (or any other) button You can use CSS to style buttons
Resetting the Form Resetting will cause all entered data on the form to be reset You can add an image to a reset (or any other) button
Other form attributes Labels Label text Will place “Label text” before the form element with id=“aName” Can be formatted with CSS Setting tab orders tabindex=“N” in element opening tag Adding keyboard shortcuts acesskey = “B” in element opening tag Disabling an element Disabled=“disabled” Prevent a element from being modified Readonly=“readonly”