I am working with a dotnetnuke module to which I don't have the source code so the only thing I can edit is the front end. Not exactly ideal, but the real world never is. Anyways, I have a button like so
<asp:ImageButton ID="btnMakePayment" runat="server" OnClientClick="michaelsFunc()" ImageUrl="checkout_btn.png" OnClick="btnMakePayment_Click"/>
I can do the validation I want in michaelsFunc() however, I need to stop the OnClick event from happening if certain things are true within my JS code. Is this possible? I tried returning false, but the form still submits. Here is the JS I was using.
function michaelsFunc() { var text = document.getElementById("shippingAmountMichael").innerHTML; if (text == "TBD") { return false; } else { return true; } }//michaelsFunc
function michaelsFunc() {
var text = document.getElementById("shippingAmountMichael").innerHTML;
if (text == "TBD") {
return false;
}
else {
return true;
}
}//michaelsFunc