i have a control inside a larger form (to upload files) and I need it to validate the entire page before it submits.
<asp:Button ID="btnUpload" runat="server" CssClass="button2" Text="Upload"
OnClientClick="if(Page_ClientValidate()) {return Page_IsValid;}"
onclick="btnUpload_Click" ValidationGroup="Bgroup" />
because this is a sub control it is not part of the main validation group (i dont want to validate it unless they hit the upload button)
currently the validation fires but then the page still submits? If the page doesnt validate I would like to stop it from submiting
Thanks!
edit
i changed the onclientclick to
javascript:return productsValidation()
which is defined as
function productsValidation() {
if(Page_ClientValidate()) {
return true;
}else {
return false;
}
}
and now it will stop at the validation but it wont submit once you update the required fields????
I got this working but i had to have it validate each of the groups separately because evidently there are othervalidation groups on the page that were not valid
a la
function productsValidation() {
if(Page_ClientValidate('g1') && Page_ClientValidate('g2')) {
return true;
}else {
return false;
}
}
I got this working but i had to have it validate each of the groups separately because evidently there are othervalidation groups on the page that were not valid
a la