Hi, I am kiran I have a task If I click one option box like country then corresponding states to appear,than I click states than next option box must display cities.please see this link you will get an idea http://www.bharatbloodbank.com/search.php How to do it in struts.
In the JSP page, put if conditions for display of fields (after the first field) to be shown only if the previous field has been set. Write helper classes, with proper constructors to feed data into the combo/select box.
The submit button can invoke the same action. Action class can check whether the last field has been set, if not return a different status like "INCOMPLETE". You will have to declare this in your action class, or ActionSupport class if you have extended from it as follows: public static final String INCOMPLETE = "incomplete"; You can map the status INCOMPLETE in struts.xml to show the same jsp page again.
But you will have to be very careful to code your helper classes, Cities/Areas etc... to have constructors which take appropriate state/city/area inputs. [ April 21, 2008: Message edited by: Subhash Bhushan ]
Regards,<br />Subhash Bhushan.
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad: