-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, Please find my demo on below link
http://zkfiddle.org/sample/118m6n0/7-ZK-combobox-tester
so, i am not able to get the 'value' of the selected comboitem. rather i am getting 'label' of selected of item
Example. if i select label 'Cool' i want value as '3'.
I want value only in javascript , not in java side
Please use below code
<?page title="Tester" contentType="text/html;charset=UTF-8"?>
<zk xmlns:w="http://www.zkoss.org/2005/zk/client">
<script type="text/javascript">
function buttonClick(){
var comboboxValue = zk.Widget.$(jq('$combo')[0]).getValue();
alert("value of selected label " +comboboxValue );
}
</script>
<window id ="asd" >
<combobox id="combo">
<comboitem label="Simple and Rich" value="1"/>
<comboitem label="Cool!" value="3"/>
<comboitem label="Ajax and RIA" value="2"/>
<comboitem label="RIA" value="s2"/>
</combobox>
<button id="clear" label="clear" w:onClick="buttonClick();"/>
</window >
</zk>
Asked: 2014-09-24 11:39:07 +0800
Seen: 69 times
Last updated: Sep 26 '14