Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Select Combo Box 1

Status
Not open for further replies.

Deltaflyer

Programmer
Oct 11, 2000
184
0
0
GB
On the click of a button i need to be able to select several entries out of a multiple combo box containing hundreds, can anybody point me to a working version of this theory or could you help me out?

I have tried to select them individually and i only end up with the last one selected.%-( It's driving me round the bend. s-)

Thanks, DeltaFlyer
The Only Programmer To Crash With Style. LOL
 
Have I got your question all wrong or is this not just a case of specifying the the select box is a multiple one.
i.e.
<SELECT MULTIPLE NAME=&quot;mySelect&quot;>
.
.
.
</SELECT>
Mise Le Meas,

Mighty :)
 
I have specified the combobox as a multiple,
<select multiple size=5 style='FONT-SIZE: 8px; FONT-FAMILY=MS Sans Serif;' name=status >

but i need to be able to select multiple entires via javascript.
i.e.
document.form.status.options[1].selected
and
document.form.status.options[2].selected
and
et cetera.

Hope this helps, DeltaFlyer
The Only Programmer To Crash With Style. LOL
 
This worked for me:
Code:
function selectMulti()
	{
	document.test.testSelect.options[0].selected = true; 
	document.test.testSelect.options[2].selected = true;
	document.test.testSelect.options[4].selected = true;
	document.test.testSelect.options[6].selected = true;
	document.test.testSelect.options[8].selected = true;
	}

<form name=&quot;test&quot;>
<select multiple size=10 name=&quot;testSelect&quot;>
<option value=&quot;5%&quot;> brussels</option>
<option value=&quot;7%&quot;> antwerp</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
<option value=&quot;5,5%&quot;> bruges</option>
</select>
<a href=&quot;#&quot; onClick=&quot;selectMulti();&quot;>Select me!</a>
</form>
&quot;The surest sign that intelligent life exists elsewhere in the universe is that it has never tried to contact us&quot;
Bill Watterson, Calvin & Hobbes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top