• 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

How to enable 2nd dropdown.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI
I have 2 drop down list. second drop down default disable.
when i select the data from first list after that second drop down should enable.
How to enable 2nd drop down.
please give me tips.

<HTML>
<HEAD>
<script>
function testenable()
{
document.getElementById('sel').enabled = true;
}
</script>
</HEAD>
<BODY>
<select id ="sel0" onclick=testenable();>
<option>country1</option>
<option>country2</option>
</select>

<select id="sel" disabled>
<option>state1</option>
<option>state2</option>
</select>
</BODY>
</HTML>
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



Try this.
 
Preethi jaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks man. Its working fine. but i need to change the event "on click="
to list selected after that 2nd drop down should enable.Please give me tips
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Preethi jaya wrote:Thanks man. Its working fine. but i need to change the event "on click="
to list selected after that 2nd drop down should enable.Please give me tips


I don't understand what exactly you wanted. If you replace your old script with one that I provided. Its works..

What's your requirement?
 
Preethi jaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now when i click the first drop down 2nd dropdown enabled thats fine.
but i want to change the on click event into onchange or selected

<select id ="sel0" onclick=enable();> into <select id ="sel0" onchange=enable();>
 
Preethi jaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sagar I got it.
reply
    Bookmark Topic Watch Topic
  • New Topic