File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes doubt regarding dropdown list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "doubt regarding dropdown list" Watch "doubt regarding dropdown list" New topic
Author

doubt regarding dropdown list

parthiban thrangaraju
Greenhorn

Joined: Feb 06, 2011
Posts: 25
Hi All,


I need a help for drop down list box.I have to generate new drop down list box if a particular option is selected.
For Eg: iam having 5 options travels,hotels,education,foundation,corporate solutions.
here for particular option i may have some other option to chose
for Eg: for travels i may have sub types car,bus and for education- school,college.
if travels or education option is selected the drop down box should be shown and if other options or selected no drop down box should be displayed.



can any one help me.

thanks in advance
parthi

Agniva Sengupta
Greenhorn

Joined: Jul 26, 2011
Posts: 16

I'm not very sure about this, but this is how it is usually done .....

Suppose you have this list :

<select name=SelectList>
<option>travel</option>
<option>hotel</option>
<option>education</option>
</select>

add an attribute

<select name=SelectList onchange='OnChange(this.form.SelectList);'>

Now... put the handler :

<SCRIPT LANGUAGE="javascript">

function OnChange(dropdown)
{

// your dropdown/checkbox population logic goes here
return true;
}


</SCRIPT>
Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

If you need to sub group, the below code syntax can be refered.



The below link may be useful.

JQuery Dropdown List
parthiban thrangaraju
Greenhorn

Joined: Feb 06, 2011
Posts: 25
thanks a lot for your help.

can any one give some sample code in struts
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/OptGroup.html


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
parthiban thrangaraju
Greenhorn

Joined: Feb 06, 2011
Posts: 25
thanks mohana rao

but i need code in struts1
parthiban thrangaraju
Greenhorn

Joined: Feb 06, 2011
Posts: 25
Hi All,


I need a help for drop down list box.
I have to show new drop down list box if a particular option is selected.
For Eg: iam having 5 options travels,hotels,education,foundation,corporate solutions.
here for particular option i may have some other option to chose
for Eg: for travels i may have sub types car,bus and for education- school,college.
if travels or education option is selected new drop down box should be shown
and if other options or selected no drop down box should be displayed.



can any one help me.

thanks in advance
parthi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt regarding dropdown list