Core HTML

Form - Multiple Selections

This HTML form example demonstrates how to code a form with a select element that allows for multiple selections. You can select multiple items in the list just as you would with any other selection, using either the shift or the ctrl key. The result must be returned as an array in order to be able to process the selection. The size specification sets the number elements that are visible.

MultipleSelectForm.html

<!DOCTYPE html>
<html>
  <head>
    <title>XoaX.net's HTML: Form - Multiple Select Example</title>
  </head>
  <body>
    <form>
      Tribes of Israel:<br />
      <select name="saTribes[]" size="8" multiple>
      	<option value="kReuben">Reuben</option>
      	<option value="kSimeon">Simeon</option>
      	<option value="kLevi">Levi</option>
      	<option value="kJudah">Judah</option>
      	<option value="kIssachar">Issachar</option>
      	<option value="kZebulun">Zebulun</option>
      	<option value="kDan">Dan</option>
      	<option value="kNaphtali">Naphtali</option>
      	<option value="kGad">Gad</option>
      	<option value="kAsher">Asher</option>
      	<option value="kBejamin">Bejamin</option>
      	<option value="kJoseph">Joseph</option>
      </select><br />
    </form>
  </body>
</html>
 

Output

 
 

© 2007–2024 XoaX.net LLC. All rights reserved.