I'm trying to save and retrieve status for a submitted form on a JSP. Retrieving textbox answers is relatively simple but for selection boxes I'm doing this:
<%String countryDB = rs.getString("countryDB"); %> //get value last submitted
Is there an easier way to write this without having to add the "<%if (country.equals("countryDB")) {%> selected <%} %>" for the hundred countries.
The above works and you could probably do it using javaScript with the onLoad function to cycle through the values of the form, but I was curious what the best way to go about this might be. Any suggestions? Thanks JW.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.