jquery - stop data-bind event in click method -
i have checkbox causes validation on textbox , data-bind viewmodel.
here fiddle.
<input id="checkbox1" type="checkbox" data-bind="checked: viewitems">checkbox</input>
i want the checkbox not data-bind when click event returns false value.
is there way this?
thanks in advance.
can not set value of observable in click method?
$('#checkbox1').click(function () { if (!$('#textbox1').valid()) { viewitems(false) alert("please enter value"); return; } else { viewitems(true) } });
Comments
Post a Comment