In JS, How do I show selected value in <select> tag, if I have value which is to be selected but don't have index. One way is I have to loop thru options of select tag, check their values. But Is there any other way to do this?
If the select tag is a single select tag, can't you just access the select tag's value? I think this will report the value of whatever option is selected.... I think.
Ryan Asleson<br />Co-Author, <a href="http://www.amazon.com/Foundations-Ajax-Foundation-Ryan-Asleson/dp/1590595823/sr=1-1/qid=1158926537/ref=pd_bbs_1/002-7412154-2924860?ie=UTF8&s=books" target="_blank" rel="nofollow">Foundations of Ajax</a> and <a href="http://www.amazon.com/Pro-Ajax-Java-Frameworks/dp/1590596773/ref=sr_11_1/002-7412154-2924860?ie=UTF8" target="_blank" rel="nofollow">Pro Ajax and Java Frameworks</a><br /><a href="http://taconite.sf.net" target="_blank" rel="nofollow">Taconite</a> Lead Developer
Joined: May 22, 2006
Thanks for the replies. But I am not satisfied with these answers. If I don't want to loop thru options of select, then is there any other way.
Hi Ryan, I didn't get what you are trying to tell. My question was, if I have which option value to be selected at time of page load(not index and don't want to access the value but wants to set the value to be selected), then what? [ September 25, 2006: Message edited by: Deepa More ]
Joined: Nov 08, 2001
He is saying set the value directly and see if it works.