How to make selected index zero for dropdown list box in java script..?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2007
Posts: 26
Reputation: BalagurunathanS is an unknown quantity at this point 
Solved Threads: 0
BalagurunathanS's Avatar
BalagurunathanS BalagurunathanS is offline Offline
Light Poster

How to make selected index zero for dropdown list box in java script..?

 
0
  #1
Aug 17th, 2007
Hi all..

I am having two dropdown list boxes in my .aspx page

They are ddl1 and ddl2...

Now if i change the selected index of the first box (ddl1), the selected index of the second dropdownlist must automaticlly set to zeroth index..i.e index of the second dropdown list box should be set to zero..Somebody provide me with the code in java script as early as posible..

Regards,
Balagurunathan S
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 3
Reputation: Nandem is an unknown quantity at this point 
Solved Threads: 0
Nandem Nandem is offline Offline
Newbie Poster

Re: How to make selected index zero for dropdown list box in java script..?

 
0
  #2
Aug 17th, 2007
  1. document.getElementById('ddl2').selectedIndex = 0;


cya
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 26
Reputation: BalagurunathanS is an unknown quantity at this point 
Solved Threads: 0
BalagurunathanS's Avatar
BalagurunathanS BalagurunathanS is offline Offline
Light Poster

Re: How to make selected index zero for dropdown list box in java script..?

 
0
  #3
Aug 18th, 2007
Originally Posted by Nandem View Post
  1. document.getElementById('ddl2').selectedIndex = 0;


cya


Thanks Nandem..I got it...


Regards,
Bala
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 3
Reputation: Nandem is an unknown quantity at this point 
Solved Threads: 0
Nandem Nandem is offline Offline
Newbie Poster

Re: How to make selected index zero for dropdown list box in java script..?

 
0
  #4
Aug 18th, 2007
No problem.
You're welcome
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC