javascript - Change the value of CJuiSlider with input box value -


i have cjuislider works fine.. when slider value changed value displayed in input box.. fine, want totally different of this. i.e. when value changed in input box (by typing value using keyboard) slider change value according value of input box..

my code is--

$this->widget('zii.widgets.jui.cjuislider', array( 'value'=>1, 'id'=>'planslider',  'change'=>'js:function{$("#plan_year").value($("#planslider").slider( "option", "value" ));}',   // additional javascript options slider plugin 'options'=>array(     'min'=>1,      'max'=>100,     'slide'=>'js:function(event, ui) { $("#plan_year").val(ui.value);}',       //'onchange'=>'js:function{$("#plan_year").value($("#planslider").slider( "option", "value" ));}',   ),   'htmloptions'=>array(       'style'=>'height:12px; width:500px'    ),  )); ?> <input type="text" name="calculator[plan_year]" id="plan_year" style="border:0; color:#f6931f; font-weight:bold;" /> 

here using java script 'change'=>'js:function{$("#plan_year").value($("#planslider").slider( "option", "value" ));}',

what missing in code?? help.. thank you

try -

<input onkeyup="$('#planslider').slider('value', this.value);" type="text" name="calculator[plan_year]" value="1" id="plan_year" style=" color:#f6931f; font-weight:bold;" /> 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

qml - Is it possible to implement SystemTrayIcon functionality in Qt Quick application -

double exclamation marks in haskell -