Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt regarding dropdown list

 
parthiban thrangaraju
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your help.

can any one give some sample code in struts
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/OptGroup.html
 
parthiban thrangaraju
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mohana rao

but i need code in struts1
 
parthiban thrangaraju
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic