如何禁用基于JSP中的条件按钮? [英] how to disable buttons based on a condition in jsp?

查看:498
本文介绍了如何禁用基于JSP中的条件按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何可以禁用通过检查我的jsp条件的按钮?如果为true,则该按钮被启用,如果为false,则该按钮将被禁用。的条件将被检查的可变的值。我知道如何禁用使用JavaScript的一个按钮,但在JSP条件一起使用,它是什么,我无法弄清楚。它是在所有可能的?

how can I disable a button by checking a condition in my jsp? If true,then the button is enabled,if false,then the button is disabled. The condition would be checking the value of a variable. I know how to disable a button using javascript, but to use it along with the condition in jsp is what I'm not able to figure out. Is it at all possible?

推荐答案

尝试使用JSTL建设是这样的:

Try using JSTL construction like this:

<input type="button" <c:if test="${variable == false}"><c:out value="disabled='disabled'"/></c:if>">

有关更多示例,请参阅 http://www.ibm。 COM / developerWorks的/ JAVA /库/ J-jstl0211 / index.html的

For more examples see http://www.ibm.com/developerworks/java/library/j-jstl0211/index.html

这篇关于如何禁用基于JSP中的条件按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆