62
rated 0 times
[
69]
[
7]
/ answers: 1 / hits: 110098
/ 12 Years ago, tue, october 9, 2012, 12:00:00
I want to be able to with a click of a link to be able to deselect all pre-selected options in a select menu with multiple select enable and with option groups.
Here is an example of the menu:
<select name=ddBusinessCategory id=ddBusinessCategory class=f1 style=width:280px;height:200px multiple=multiple>
<option value=>Select One</option>
<optgroup label=Abrasives style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=4 selected=selected>Abrasives</option>
</optgroup>
<optgroup label=Abstracters style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=5>Abstracters</option>
</optgroup>
<optgroup label=Abuse Information & Treatment Centers style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=6 selected=selected>Abuse Information & Treatment Centers</option>
</optgroup>
<optgroup label=Accountants style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=7>Accountants</option>
<option value=2672>Certified Public Accountants - </option>
<option value=2673>Public Accountants - </option>
</optgroup>
<optgroup label=Accounting Services style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=8>Accounting Services</option>
</optgroup>
<optgroup label=Acoustical Materials - Wholesale & Manufacturers style=background:#F5F5F5;border-bottom:1px #EEE solid>
<option value=9>Acoustical Materials - Wholesale & Manufacturers</option>
</optgroup>
</select>
You will see two are selected.. I want to be able to deselect these preselected ones.
DONT want to use jquery, just want to use javascript
Many thanks for your assistance.
neojakey
More From » javascript