komlaaa
asked on
Strut HTML Tags
Hi,
How do i force this list box to select only one item at time
<html:select multiple >
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
How do i force this list box to select only one item at time
<html:select multiple >
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
sorry,
forget about the above post, i forgot to put the property attribute.
<html:select style="width:120px" property="nameOfProperty" name="formName">
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
fargo
forget about the above post, i forgot to put the property attribute.
<html:select style="width:120px" property="nameOfProperty" name="formName">
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
fargo
and id you wish to keep it multiple selection but only show one entry
<html:select style="width:120px" property="nameOfProperty" name="formName" multiple="true" size="1">
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
fargo
<html:select style="width:120px" property="nameOfProperty" name="formName" multiple="true" size="1">
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
fargo
ASKER
the user shouldn't be able to select more one entry even if he/she try to press control key
ASKER
>multiple="true
Shouldn't that be multiple="false"
Shouldn't that be multiple="false"
ASKER
+ i would like to set the size = "the size of the items in the list box", not know till run time
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
>if you don't want user to select more than one, definitely you should just remove the multiple and the size attributes
if i do, it will turn to combo or drop down menu which i don't want.
if i do, it will turn to combo or drop down menu which i don't want.
Hi,
I don't think it is directly possible. May be you need to make use of javascript to make it happen.
regards,
fargo
I don't think it is directly possible. May be you need to make use of javascript to make it happen.
regards,
fargo
ASKER
Please just tell me what the difference between "drop down menu" and List menu using <html:select> tags?
sure you are not talking about menu..correct?
AFAIK, drop down box and list box and select list are all same. There is no difference.
regards,
fargo
AFAIK, drop down box and list box and select list are all same. There is no difference.
regards,
fargo
ASKER
thanks fargo.
<html:select>
<html:options collection="states" property="value" labelProperty="label" />
</html:select>
fargo