HTML Forms

Forms

<form>
<input name="firstName"/>
<button type="submit">Send</button>
</form>
- Allow users the enter data in various standard controls
- Allow basic submition of that data to the server
Forms - input tag
- value - the value of the control
- type - it's purpose
- submit
- button
- text
- password
- color
- radio
- checkbox
- file
- hidden
- ...

Forms - select tag
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>

Forms - other tags
<label for="description">some text</label>
<textarea id="description">
some text
</textarea>
<textarea rows="10" cols="30">
some text
</textarea>
<button type="button">Click Me!</button>

form attributes
- method - the HTTP method
- action - the url to submit to

form attributes
- method - the HTTP method
- action - the url to submit to

Exercise
- Use the DevTool selection tool to inspect various elements on a page
- Which do you think is block and which is inline ?

End

HTML Forms
By Netcraft
HTML Forms
- 821