|
-
Dec 6th, 2000, 12:36 PM
#1
Thread Starter
Member
how can i see the value of a combobox in Javascript
like i write this code and it doesn't worked.
document.frmCart.Carts.options.value=x;
alert(x);
frmCart = Name of form
Carts = Name of Select(ComboBox)
Thanxs all
-
Dec 6th, 2000, 12:53 PM
#2
If you give your <OPTION> elements a VALUE attribute you can see the value with something like frmWhatever.selWhatever.value - for example:
<P><SELECT NAME="selTest">
<OPTION VALUE="Red">Red
<OPTION VALUE="Blue">Blue
<OPTION VALUE="Green">Green
</SELECT></P>
<P><BUTTON onClick="alert(selTest.value)">Click Me</BUTTON></P>
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|