PDA

Click to See Complete Forum and Search --> : Is there a way


mart37
Dec 6th, 2000, 11:36 AM
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, 11:53 AM
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