hi to all,
Here i want to call two javascript in single onclientclick event two are different scripts one is normal script and another one is return(true or false).
code is attached below:
<asp:Button ID="cmdSave" ValidationGroup="purchaseval" runat="server" Text="" CssClass="savebutton1231" OnClientClick="ClientSideClick(this);return ConfirmNEW();"
EnableTheming="false" OnClick="cmdSave_Click" SkinID="skinBtnSave" />
above button not fire cmdsave_click.bcz one script want to return and another is a normal script how to differentiate this two scripts
this is my scriptS:-
function ClientSideClick(myButton) {
// if (typeof (Page_ClientValidate) == 'function')
{
// var isPageValid = true;
var isGrpOneValid = Page_ClientValidate("purchaseval");
if (isGrpOneValid == true) {
if (myButton.getAttribute('type') == 'button')
{
alert(isGrpOneValid);
myButton.disabled = true;
myButton.className = "btn-inactive";
myButton.value = "processing...";
}
}
}
}
above script for multiple click avoid
function ConfirmNEW() {
if (Page_ClientValidate()) {
var GridId = "<%=grvStudentDetails.ClientID %>";
var grid = document.getElementById(GridId);
rowscount = grid.rows.length;
for (var i = 1; i < rowscount; i++) {
var indexID = 01 + i;
var vatch = document.getElementById('ctl00_cplhControlPanel_tabs2_TabPanel2_grvStudentDetails_ctl' + ((indexID < 10) ? '0' + indexID.toString() : indexID.toString()) + '_txtVATPre').value;
var cstch = document.getElementById('ctl00_cplhControlPanel_tabs2_TabPanel2_grvStudentDetails_ctl' + ((indexID < 10) ? '0' + indexID.toString() : indexID.toString()) + '_txtCSTPre').value;
__doPostBack('cmdSave', "")
if ((vatch != "" && vatch <= 0) && (cstch != "" && cstch <= 0)) {
if (confirm("VAT(%) and CST(%) are Zeros(0) in row" + i + ".Do you want to Continue?")) {
return true;
}
else {
return false;
}
}
}
}
}
this for confirm purpose.