Currently I’m making a form with JSP that I need to have a couple fields display, or not display depending on a check box value. Since I’m new to JSP, I’m wondering is it possible in JSP to do this without javascript? (Asking this question just in the case a user goes to fill out the form fields with js disabled, whats my fallback?)
Share
Your first step would be to replace those checkboxes by submit buttons. You can’t let a checkbox submit the form without using JavaScript
onclick="submit()". You can if necessary throw in some CSS to make those buttons to look like a checkbox by removing/changing the background/border/inset/font.After having changed that, just let JSP generate the desired HTML conditionally using JSTL
<c:if>tags and like.E.g.
with CSS something like as