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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -