File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to enable 2nd dropdown.

 
Preethi jaya
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Try this.
 
Preethi jaya
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • 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: 2906
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar I got it.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic