J
Jennifer Mathews
In the code below, I have a <Save> button firing. I have taken out the JavaScript
validation code but it ends with "return false;" if there are errors. The Code Behind
still fires eventhough there is a "return false;" statement in the JavaScript. Why? I
thought that should prevent the Code Behind from firing. How should I stop it from
firing when there is a validation problem?
Thanks
<asp:ImageButton ID="cmdSave" runat="server" ="~/Save.jpg" AlternateText="Save"
ValidationGroup="rfvg_Submit" OnClientClick="ucEU_Add_User_cmdSave();" />
function ucEU_Add_User_cmdSave() {
alert("START ucEU_Add_User_cmdSave");
// Make sure either Cmp_Item_ID or Cmp_Item_Name is filled-in.
return false;
}
validation code but it ends with "return false;" if there are errors. The Code Behind
still fires eventhough there is a "return false;" statement in the JavaScript. Why? I
thought that should prevent the Code Behind from firing. How should I stop it from
firing when there is a validation problem?
Thanks
<asp:ImageButton ID="cmdSave" runat="server" ="~/Save.jpg" AlternateText="Save"
ValidationGroup="rfvg_Submit" OnClientClick="ucEU_Add_User_cmdSave();" />
function ucEU_Add_User_cmdSave() {
alert("START ucEU_Add_User_cmdSave");
// Make sure either Cmp_Item_ID or Cmp_Item_Name is filled-in.
return false;
}