I’m not able to call the javascript from a Yii widget.
Below is the script :
<script>
var removed;
$('#min').change( function() {
var value = this.value;
console.log("value",value);
$('#max').prepend(removed);
var toKeep = $('#max option').filter( function( ) {
return parseInt(this.value) >= parseInt( value);
} );
removed = $('#max option').filter( function( ) {
return parseInt(this.value) < parseInt( value);
} );
$('#max').html(toKeep);
});
</script>
When I use this, it is not working. How can i call this script from widget
Below is the Yii widget used :
<?php
$this->widget('ext.combobox.EJuiComboBox', array(
'model' => $model,
'attribute' => 'min',
'data' => Yii::app()->params['cost_min_resales'],
'options' => array(
'allowText' => false,
),
'htmlOptions' => array('placeholder' => 'Min Cost', 'style'=>'width:70px'),
));
?>
<?php
$this->widget('ext.combobox.EJuiComboBox', array(
'model' => $model,
'attribute' => 'max',
'data' => Yii::app()->params['cost_min_resales'],
'options' => array(
'allowText' => false,
),
'htmlOptions' => array('placeholder' => 'Min Cost', 'style'=>'width:70px'),
));
?>