CssClass="button green savensendbtn" OnClick="btnCommit_Click" OnClientClick="return ValidSave();" />
My Java Script is-
-----------
Problem is my Java Script code is not firing on Button click.
is any one have adea about this?
My Java Script is-
-----------
function ValidSave() {
if (typeof (Page_ClientValidate) === "function")
if (!Page_ClientValidate())
return false;
if ($("span[id$='lblPayPalUserMissing']").attr("IsMissing") == "true" && $("input[id*='rblPaymentMode']:checked").val() == '<%= ZippSlips.Core.Model.Enums.PaymentMode.CreditCard %>') {
$.blockUI({ message: $("div#MissingPaypalAccountError") });
return false;
}
else if ($("#liMandatoryItemError").length > 0 && $(".paymentgrid").find("input[type='radio'],input[type='checkbox']").length > 0 &&
$(".paymentgrid").find("input[type='radio']:checked,input[type='checkbox']:checked").length == 0) {
$("#liMandatoryItemError").removeClass("hide");
return false;
}
else {
return true;
}
}
Problem is my Java Script code is not firing on Button click.
is any one have adea about this?
9 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

ravi GautamPosted Oct 15, 2017, 4:01 PM
Biswa Pujarini MohapatraPosted Feb 14, 2014, 4:01 AM
btn.attributes.add("OnClientClick", "javaScript: return ValidSave(););
SartajPosted Feb 14, 2014, 3:50 AM
Add in button ClientIDMode="Static" for Java Script firing
example :
Enjoy...
Jignesh TrivediPosted Feb 13, 2014, 4:20 AM
ok
you are _dopostback event.
this is also call from javascript if I am not wrong.
Jignesh TrivediPosted Feb 13, 2014, 4:20 AM
ok
you are _dopostback event.
this is also call from javascript if I am not wrong.
Abhineet SrivastavaPosted Feb 13, 2014, 4:15 AM
Abhineet SrivastavaPosted Feb 13, 2014, 4:11 AM
Can't remove OnClick function,it have other functionality.
Biswa Pujarini MohapatraPosted Feb 13, 2014, 3:13 AM
try this
Jignesh TrivediPosted Feb 13, 2014, 3:06 AM
I think nothing wrong in you code.
just check whether your Js function is called or nor?
also check is your JS function reachable by your Page i.e are you define this in ASPX file or separate JS file?