This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable text input based on actionform value

 
Mike Dell
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a boolean value in my action form:
private boolean disableForm;

How can I disable a text input based on the value of disableForm? The follow below does not work
<html:text name="WorkForm" styleId="maildate" property="mailDate" maxlength="10" size="10" disabled="<%=disableForm.booleanValue()%>" />
 
Kartik Tal
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First keep the boolean value in request in Action class.




and in jsp take in this way


The other way is from Scriplet you can do.
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The disabled attribute doesn't understands true/false values. Its value is disabled i.e. disabled="disabled". So you'll need to use a condition and generate the disabled attribute only if you want to disable the text box...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic