asp.net - Javascript : Return false is not working : even after I press cancel the code gets executed -
asp.net - Javascript : Return false is not working : even after I press cancel the code gets executed -
javascript : homecoming false not working, after press cancel code gets executed
i trying execute 2 javascripts 1 button. when sec script executes, if click cancel code executed. below code. can please help me?
<script type="text/javascript" language="javascript"> var targetbasecontrol = null; window.onload = function () { seek { //get target base of operations control. targetbasecontrol = document.getelementbyid('<%= this.gridview1.clientid %>'); } grab (err) { targetbasecontrol = null; } } function testcheckbox() { if (targetbasecontrol == null) homecoming false; //get target kid control. var targetchildcontrol = "chkselect"; //get command of type input in base of operations control. var inputs = targetbasecontrol.getelementsbytagname("input"); (var n = 0; n < inputs.length; ++n) if (inputs[n].type == 'checkbox' && inputs[n].id.indexof(targetchildcontrol, 0) >= 0 && inputs[n].checked) homecoming true; alert('please select @ to the lowest degree 1 request close!'); homecoming false; } function updateconfirmation() { if (confirm("are sure, want close selected request ?") == true) homecoming true; else homecoming false; } </script> <asp:button id="btnupdate" runat="server" onclick="btnupdate_click" text="close request" onclientclick="var b = testcheckbox(); if (b) updateconfirmation(); homecoming b"/>
you should add together homecoming while calling function.
<asp:button id="btnupdate" runat="server" onclick="btnupdate_click" text="close request" onclientclick="if(testcheckbox()) homecoming updateconfirmation();"/>
javascript asp.net return
Comments
Post a Comment