Welcome to Dream.In.Code
Become an Expert!

Join 149,526 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,465 people online right now. Registration is fast and FREE... Join Now!




quick dom help

 
Reply to this topicStart new topic

quick dom help

theRemix
30 May, 2007 - 09:15 PM
Post #1

D.I.C Regular
***

Joined: 19 Oct, 2005
Posts: 386



Thanked: 3 times
My Contributions
How can i set the selectedIndex of a select input by it's value, instead of the option's index?

tia.
User is offlineProfile CardPM
+Quote Post

Arbitrator
RE: Quick Dom Help
31 May, 2007 - 12:09 AM
Post #2

D.I.C Regular
Group Icon

Joined: 26 Jan, 2005
Posts: 492



Thanked: 1 times
My Contributions
Loop through the option elements until you find the one that matches the desired value. Then take its index and use it to change the selected index.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:48PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month