• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doubt regarding dropdown list

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Greenhorn
Posts: 16
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot for your help.

can any one give some sample code in struts
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic