Forms exercise
Example form
- Review - Set up basic html elements for a page.
- Set up opening and closing form tags (within the Body tags). Use the defined action for FormMail (in example).
- Insert a text field for Name. Remember to add the text outside the field for the user to see. Use <br> for line breaks or for extra spaces.
- Insert a text field for E-mail.
- Insert the Submit and Reset buttons (setting a value is optional).
- Set the "recipient" and "redirect" hidden fields. Other hidden fields are optional.
Note: you can set the redirect to an existing URL or web page or create your own Thank You page and point to it.
- Save as "form.html"
- Open in browser to view.
- Test.
If time allows, insert these other form fields:
- Insert a text area and define size and wrapping.
- Define 3 or more checkboxes with a question that may have multiple answers.
- Define 2 or more radio buttons with a question that needs only one answer: yes/no, gender, etc.
- Set up a select list with 3 or more choices.
- Save.
- Open in browser and test.
View exercise with answer key (not for classroom students)