- Forms can have many different components:
- All form objects must be contained in a form field.
- can have a name, ID and action (as well as other tag attributes). The action describes what happens when the submit button is clicked.
- Create a Form tag
- Should have an action attribute
- Should have an id attribute
- Should have a method attribute
<form action="formProcessor.php" id="contact" method="post"></form>
*Example form pages can be downloaded here
- Form objects are then inserted.
- Text field
- names
- emails
- addresses
- Text area
- messages
- comments
- Checkboxes (for multiple options)
- <input name="list" id="list" type="checkbox" value="four year degree">
<input name="list" id="list" type="checkbox" value="Two year degree">
<input name="list" id="list" type="checkbox" value="Certificate">
- <input name="list" id="list" type="checkbox" value="four year degree">
- Radio buttons (for a single option)
<label>
<input name="radio" id="radio" value="yes" type="radio">
yes</label>
<label>
<input name="radio" id="radio2" value="no" type="radio">
no</label>
- boolean values (yes/no, true/false)
- List menu/jump menu
- Text field
- for drop down menu items
<select name="select" id="select">
<option value="CO">Colorado</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
</select>- states
- item attributes
- multiple choice
- url list
- Submit button
- Submit will perform the action stated in the form tag
- Reset will reset form fields to original state
- All form objects must be contained in a form field.