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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling html:select

Status
Not open for further replies.

warelock

IS-IT--Management
Aug 16, 2005
12
US
Hi all !

I want to disable an html:select at run time based on user actions. How can I do that - or CAN I do that ? ;-0)

Thanks in advance -
 
Hi,

The property to disable select is disabled="true"

<html:select disabled="true"

Cheers
Venu
 
Thank Venu.

I guess I should explian a little more ;-)

I am using a collection, and want to set disabled = true if the user is of a certain type and not otherwise. Right now the code looks like :

<html:select property="agencyNo">
<html:eek:ptionsCollection name="sessionData"
property="agencyList" label="label" value="value"/>
</html:select>


I want to embed a Struts/JSTL tag in the html:select tag that tests the value of another string ... something like this :

<c:set var="testVal" value="true"/>
<html:select property="agencyNo"
disabled="<c:eek:ut value="${testVal}"/>">
<html:eek:ptionsCollection name="sessionData"
property="agencyList"
label="label"
value="value"/>
</html:select>

This code does not compile, because compiler says

Error(162): Attribute: ${testVal}"/ is not a valid attribute name

So I am looking for a way to do this ... any ideas ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top