Click to See Complete Forum and Search --> : Drop Down list


lakshman
05-01-2003, 03:30 AM
Hi everyone,

Can we select by value instead of document.form3.select.selectedIndex=2;
??

The reason is that my select option is built from a table in the database at run time. I cannot use index numbers as the order may change.

Where can I get the full attribute listing for all this HTML stuff.

Thanks in advance.

beebob
05-01-2003, 03:32 AM
try innerText

lakshman
05-01-2003, 08:09 PM
Didn't work but I found another psoting by AdamBrill
document.formname.selectname.value="Number 2";

That works.

Thanks All.

lakshman
05-01-2003, 09:05 PM
Yes, IE & Netscape.

What is your suggestion.

Nedals
05-01-2003, 09:30 PM
Try this...
value = document.theform.sel.options[document.theform.sel.selectedIndex].value

lakshman
05-01-2003, 11:35 PM
Thanks a lot dave you have made my day again.

Oh how I love the web and this Forum.


Thanks again.

lakshman
05-02-2003, 02:07 AM
Hi Dave,

If you are still on-line and you have some time to spare for little old me (again).

Could you give me your suggestion on this.

http://forums.webdeveloper.com/showthread.php?threadid=8820&goto=newpost