I have an ASP .NET page with ASP validators (Required Field, Regular Expression,...) plus java script functions for additional validation (for example, to check if second date b
I solved this problem by creating a variable:
Boolean fieldIsValid = true;
and in the custom validating expression method I would change the value if arguments weren't true:
if(args.IsValid == false)
{
fieldIsValid = false;
}
else
{
fieldIsValid = true;
}
Then, I also put that in the submit click method:
protected void submit_Click(object sender, EventArgs e)
{
if (fieldIsValid)
{
//submit my things
}
}