HTML and CSS Reference
In-Depth Information
Click here to view code image
1. <form class="col-1-3" action="#" method="post" >
2. ...
3. </form>
6. Next, inside the <form> element we'll add a <fieldset> element. Inside the
<fieldset> element we'll add a series of <label> elements that wrap a given
form control.
We want to collect a user's name, email address, number of desired conference
passes, and any potential comments. The name, email address, and number of con-
ference passes are required fields, and we'll want to make sure we use the appro-
priate elements and attributes for each form control.
With a mix of different input types, select menus, textareas, and attributes, the
code for our form should look like the following:
Click here to view code image
1. <form class="col-1-3" action="#" method="post">
2.
3. <fieldset>
4.
5. <label>
6. Name
7. <input type="text" name="name" placeholder="Full name"
required>
8. </label>
9.
10. <label>
11. Email
12. <input type="email" name="email" placeholder="Email address"
required>
13. </label>
14.
15. <label>
16. Number of Passes
17. <select name="quantity" required>
18. <option value="1" selected>1</option>
19. <option value="2">2</option>
20. <option value="3">3</option>
21. <option value="4">4</option>
22. <option value="5">5</option>
23. </select>
24. </label>
25.
26. <label>
27. Comments
28. <textarea name="comments"></textarea>
Search WWH ::




Custom Search