Now , I created two dropdownlists (min and max) using the below code.
<?php
$this->widget('ext.combobox.EJuiComboBox', array(
'model' => $model,
'attribute' => 'min', 'data'=>array('100000.0'=>'1lakh','200000.0'=>'2lakh','300000.0'=>'3lakh','400000.0'=>'4lakh'),
'assoc'=>true,
'options' => array(
'onSelect' => 'cost_change(item.value);',
'allowText' => false,
),
'htmlOptions' => array('placeholder' => 'Min Cost', 'style'=>'width:30px'),
));
?>
<?php
$this->widget('ext.combobox.EJuiComboBox', array(
'model' => $model,
'attribute' => 'max',
'data' => array('300000.0'=>'3lakh','400000.0'=>'4lakh','500000.0'=>'5lakh','600000.0'=>'6lakh'),
'options' => array(
'allowText' => false,
),
'htmlOptions' => array('placeholder' => 'Max Cost', 'style'=>'width:30px'),
));
?>
I’m calling a script on selecting the min value which in turn calls the script
<script>
function cost_change(price) {
var value = price;
console.log("value",value);
jQuery('#max').html( jQuery('#SearchForm_min_cost_select').html())
var toKeep = jQuery('#max').filter( function( ) {
return parseInt(this.value) > parseInt( value);
} );
console.log("to keep",toKeep);
jQuery('#max').html(toKeep);
}
</script>
Now my problem is when I select 1lakh as min value in dropdown, 1lakh is passed to script instead of 100000.0. What should I pass to the function cost_change to pass 100000.0 instead of 1lakh.