-
Dec 19th, 2010, 10:58 PM
#1
retaining selected value of Drop Down Box
Hi,
I have a simple user registration form (register.jsp) with some textboxes and dropdown boxes. All the user info. is collected using a java class "User". I am able to bind the User class with "register.jsp" using a servlet "RegisterController.java". I want to retain values inside the textbox and dropdown box after the page postback i.e. when form reloads after submit (may be to show some errors like "compulsory fields kept blank by user etc..) So far I am able to retain values of textbox using <spring:bind path="">
tag and ${status.value} expression. But this approach does not work for the dropdowns. Dropdown resets itself to the default(0 th) value after postback.
How to retain selected value of a dropdown? and also for radio buttons and checkboxes?
Further I am using an enum for drop down choices. So how to bind enum with the HTML/JSP drop down tags i.e. select tag?
Thanks in Advance
Sujit..
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules