Using the size and multiple Attributes on the select element
You can select multiple options by pressing the Ctrl button while clicking.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form method="post" action="http://yourServer/form">
<input type="hidden" name="recordID" value="1234" />
<p>
<label for="name"> Name: <input value="Adam" id="name"
name="name" />
</label>
</p>
<p>
<label for="password"> Password: <input type="password"
placeholder="Min 6 characters" id="password" name="password" />
</label>
</p>
<p>
<label for="fave" style="vertical-align: top"> Favorite:
<select id="fave" name="fave" size="5" multiple>
<option value="apples" selected label="Apples">Apples</option>
<option value="oranges" label="Oranges">Oranges</option>
<option value="cherries" label="Cherries">Cherries</option>
<option value="pears" label="Pears">Pears</option>
</select>
</label>
</p>
<input type="submit" value="Submit" />
</form>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
select:
- Creating Lists of Options
- Using the size and multiple Attributes on the select element
- Adding Structure to a select Element
Related: