Jquery Smartspinner Reset Value -


i use jquery smartspinner it's work fine can't reset value in function onload set initvalue:3 when set new value in smartspinner box dont override new value set old initvalue in

thats plugin

var duration = $("#bookingduration").spinit({ height: 18, width: 65, min: 1, initvalue: 3, max: 62 }); 

now have calender , send new duration in box

$('#cdateto').datepicker({ dateformat: 'dd.mm.yy', mindate: $('#cdatefrom').datepicker('getdate'), onselect: function () {     // diff     var d1 = $('#cdatefrom').datepicker('getdate');     var d2 = $('#cdateto').datepicker('getdate');     var diff = 0;     if (d1 && d2) {         diff = math.floor((d2.gettime() - d1.gettime()) / 86400000);     }             duration.reset(diff);             $("#bookingduration").val(diff);  } }); 

when diff 10 , press key or down load old initvalue 3 have trails withe jquery val override not work

if deciphered english, need store widget variable:

var spinner = $("#bookingduration").spinit({ height: 18, width: 65, min: 1, initvalue: 3, max: 62 }); 

and call method reset when need:

spinner.reset(diff) 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -