PDA

View Full Version : combobox getValue() & .value doesn't work


zhangling
01-13-2005, 09:35 PM
Looks so strange:

<combobox id="langbox" width="120" editable="false">
<textlistitem text="简体中文" value="zh_cn"/>
<textlistitem text="English" value="en_us" selected="true"/>
<method event="onvalue"> <![CDATA[ canvas.datasets.lp.setSrc("language_" + langbox.value + ".xml");
var d = canvas.datasets.lp;
d.doRequest(); ]]>
</method>
</combobox>

The combox .getText() and .getValue() returns the same thing: the text appear on combobox but not the value associated with the text. The "combobox.value" doesn't work too.

Then how to get the selected value in a combobox. For above example, I want to get "zh_cn" or "en_us", not "简体中文" or "English".

I'm using 3.0b1.

frocher
03-07-2005, 07:50 AM
You should only use numeric values for value attribute.