I want disable HTML button depending on value present in Spring bean.I am using JSTL empty
property but no luck.
Here is my code
<input type="submit" value="SendEmail" disabled="${empty reportNotificationFbo.providersList}" >
Here reportNotificationFbo
is spring bean and providersList
is a list.
I want to disable Submit
button if providersList
is empty.
-Thanks.
No. It is not possible to have JSTL in HTML page.
stackoverflow.com. 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 ...
JSP lets you even define your own tags (you must write the code that actually implement the logic of those tags in Java). JSTL is just a standard tag library provided by Sun (well, now Oracle) to carry out common tasks (such as looping, formatting, etc.).
JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc.
State of the button is controlled by the presence of disabled
attribute, not by its value. Try the following:
<input type="submit" value="SendEmail"
"${(empty reportNotificationFbo.providersList) ? 'disabled' : ''}" >
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With