javascript - Checkbox changed event does not call event after return true from clientside -


i have checkbox , function

<asp:checkbox id="ckbtest" runat="server" cssclass="label" text="responsible persons"      autopostback="true" onclick="return foo()" />   function foo(){                 if (false) {                   alert('some alert.');                   return false;                   }                   else{                   return true;                   }                 } 

when click on checkbox , returns true function after not going server side

i suppose go serverside after return true function

server side method

protected sub ckbtest_checkedchanged(byval sender object, byval e system.eventargs) handles ckbtest.checkedchanged          try      code         catch ex exception          end try      end sub 

presuming foo() java-script function . code needs be

<asp:checkbox id="ckbtest" runat="server" cssclass="label" text="responsible persons" onclientclick="return foo()" /> 

the attribute onclick fires server side functions , autopostback property automatically initializes post server.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -