Writing forms
Readings
Chapter 17.
On the Web
- Documentation for email.
- Nielsen on correct use of check boxes and radio buttons.
- A common form layout involves right-aligning the form element labels, and left-aligning the input boxes.
Generally speaking, before you can write up a form, you need to know the URL of the script it will be communicating with, and the variables and values that the script understands.
For this class, we'll play around with a general purpose cscript called "email" that will take any variables and values that you give it: Whatever you give it will be packaged up into an e-mail message that will be sent to the address coded in the variable recipient.
Homework: Favorite Fruit
[Pretend that] You are a member of the Citrus Marketer's Association, and you're giving away cool citrus marketing loot to folks that fill out a brief survey on the web. Create a form visitors to your page can fill out...
- that uses the "email" script to package up the results and send them off via e-mail.
- with space for their name (in a text box).
- Have them indicate their favorite kind of citrus fruit among grapefruit, oranges, lemons, or other (use a set of radio buttons), and
- select (from a drop-down menu) whether they want to submit the form to you or your instructor: This will result in setting the variable recipient to have your e-mail address as its value, or else 'paulmr@goshen.edu'.
- Set the e-mail subject line (variable name is subject) with a hidden input field.
Hand it in on Moodle.
