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
Post a Comment