<select name="colours">
<option value='blue'>Blue</option>
<option value='green'>Green</option>
</select>
Attribute | Description |
---|---|
autofocus | The element is in focus (by default ) when the page loads. |
disabled | The element is in disabled state for the user. |
Name | This attribute specifies the name of the object through which it can be referenced. |
size | Interger : Used to specify the number of visible items in the list. |
Multiple | If given yes, then multiple choices can be made. |
Attribute | Description |
---|---|
value | Used to specify the value to be submitted if the form has been submitted. |
selected | Default selection of the option |
Favourite color:
<SELECT name="ddl">
<option value='blue'>Blue</option>
<option value='green'>Green</option>
<option value='red'>Red</option>
<option value='yellow'>Yelllow</option>
<option value='' selected>Select a Color </option>
<option value='white'>White</option>
</SELECT>
Here is the output:
<select name="ddl" width=300 STYLE="width: 350px">
<option value='blue'>Blue</option>
<option value='green'>Green</option>
<option value='red'>Red</option>
<option value='yellow'>Yelllow</option>
<option value='' selected>Select a Color </option>
<option value='white'>White</option>
</select>
Multiple selection from a dropdown listbox
<select name="ddl" size=4 multiple>
<option value='blue'>Blue</option>
<option value='green'>Green</option>
<option value='red'>Red</option>
<option value='yellow'>Yelllow</option>
<option value='' selected>Select a Color </option>
<option value='white'>White</option>
</select>
We can group the options under different heads. We can use optgroup to manage such group of options.
multiple selection options of list box are handled using PHP
sultan | 30-09-2014 |
i want to select multiple values from drop-down list without using jquery or javascript as well as without pressing 'ctrl' or 'shift' key... please help... thanx in advance...... |
AravindAK | 30-12-2016 |
Have to select multiple values in drop-down and also pass the value to next page with selected values...How to do??? |
smo1234 | 19-02-2017 |
As explained above you can use multiple selection dropdown to give user choice to select more than one choice. On submission of the form it will be available in next page ( defined by action of the form ) and you can collect the inputs as an array by using PHP. |
suma | 13-02-2018 |
i want to select multiple values from drop-down list at a time two multiple value select pls send the code html,jquery |