multiple property (keygen, select)
Sets or retrieves whether more than one item from a list can be selected.
The select element, or the selection list of the keygen element allows simple or multiple selection, depending on the state of the multiple property.In a non-empty drop-down list always exactly one selected element exists. If there is no element selected by default in a drop-down list, the first option will be selected.
- If multiple selection is allowed, the visual appearance of the selection list can only be a list box.
- If only one selected element is allowed, the selection list may be a drop-down list or a list box. The default appearance is the drop-down list in that case.
If the value of the size property is greater than one, the appearance of the selection list is a list box.
In a single-selection list box the count of the selected items can be 0 (if the list box does not have a selected element by default) or 1.
In a multiple-selection list box the count of the selected items can be from 0 to the number of the items.
You can set the element(s) selected by default with the SELECTED attribute.
If you want to use the selection list in an form element and you want to submit data that belongs to the selection list with the form, see the page for the select element, you can find detailed technical information there.
You can find the related objects in the Supported by objects section below.
This property is read/write.
|HTML page for this property: MULTIPLE|
Boolean that indicates whether multiple selection is allowed.
One of the following values:
|Default. Multiple selection is disabled.|
|Multiple selection is enabled.|
Example HTML code 1:
This example illustrates the use of the MULTIPLE attribute:
Example HTML code 2:
This example illustrates the use of the multiple property:
Example HTML code 3:
This example displays the text of the selected items in a multiple-selection list:
Example HTML code 4:
This example is similar to the previous one but it displays the value of the selected items in a multiple-selection list:
User Contributed Comments