kyama1
asked on
dropdown list
i written code for dropdown list which is multiple selecion list.what i need is i want to refer each selected item by its name so that i can use that name in somewhere else.
i am using name attribute for option tag also, i donot know option tag has name attribute.
<select name=menu multiple>
buffer.append("<OPTION name=on24url"+i+" value="+urlroot+sChon24[i] +">Consume r: health</OPTION>");
</select>
why i need this is i used check box
<input type=checkbox name=on24url"+i+" value="+urlroot+sChon24[i] +"> iam using this one in the following code.
sChurl[i]=portal.getUser() .getProper ty("on24ur l"+i);
iam trying to implement drop down list instead of checkbox.
i need solution immediatly
i am using name attribute for option tag also, i donot know option tag has name attribute.
<select name=menu multiple>
buffer.append("<OPTION name=on24url"+i+" value="+urlroot+sChon24[i]
</select>
why i need this is i used check box
<input type=checkbox name=on24url"+i+" value="+urlroot+sChon24[i]
sChurl[i]=portal.getUser()
iam trying to implement drop down list instead of checkbox.
i need solution immediatly
the code of a multiple select is this:
<select name="myselect" multiple>
<option value="value1">text1</opti on>
<option value="value2">text2</opti on>
<option value="value3">text3</opti on>
<option value="value4">text4</opti on>
</select>
so you must generate in this way:
<select name=menu multiple>
buffer.append("<OPTION value="+urlroot+sChon24[i] +">Consume r: health</OPTION>");
</select>
and if you need to refer to the selected items in the same page you can use javascript:
<script language="javascript">
<!--
idSelect = document.my_form_name.myse lect
for (iTmp=0; iTmp < idSelect.options.lengt; iTmp++) {
if (idSelect.options[iTmp].se lected) {
alert("Option selected " + idSelect.options[iTmp].tex t + " value: " + idSelect.options[iTmp].val ue)
}
}
//-->
</script>
xabi
ps: Please write me if you need more help or my answer is now correct.
<select name="myselect" multiple>
<option value="value1">text1</opti
<option value="value2">text2</opti
<option value="value3">text3</opti
<option value="value4">text4</opti
</select>
so you must generate in this way:
<select name=menu multiple>
buffer.append("<OPTION value="+urlroot+sChon24[i]
</select>
and if you need to refer to the selected items in the same page you can use javascript:
<script language="javascript">
<!--
idSelect = document.my_form_name.myse
for (iTmp=0; iTmp < idSelect.options.lengt; iTmp++) {
if (idSelect.options[iTmp].se
alert("Option selected " + idSelect.options[iTmp].tex
}
}
//-->
</script>
xabi
ps: Please write me if you need more help or my answer is now correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i think i got idea, but iam not sure it will work for my case.anyway thanks for your help. if i need help i will mail you again
only let the value is unique, that is enough i think