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

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -