Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to disable a button  RSS feed

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my JSP page I am supposed to have "submit", "cancel" button. But sometimes I only want one of them and disable the other one, what's the good and easy way to do that ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use JSTL' <c:if> and set the "disabled" attribute to your button.

<c:if test="${your_test_here}">disabled<c:if>
 
sundaramoorthi thangavel
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you explain your scenario a little bit?

If you want to disable the button while the form is displayed, check the condition in JSP and put 'disabled' property in <input> tag.

If you want to disable when an event is triggered, like click event or something, you can use javascript
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!