Is is possible to specify another error message if the regex doesn't match, e.g. "The input isn't a valid e-mail address"?
Just like the ASP.NET RegularExpressionValidator , where the RequiredFieldValidator is used to check whether the field is empty or not. Here it just use the same error message for blank fields and wrong input.
I don't think so, the regex validator is used for all content, regardless of what type of content needs validation. So, no, but could provide some help info (can be set for each prop) for your users to make sure they enter valid data from the first time. Defo not a solution, but it would work.
Okay.. the validator use the regex for the e-mail field.. and it might be using some other function to check if a field is blank?
anyway it would be more appropriate to have a error message saying, that it isn't a valid e-mail address instead of "please enter your e-mail" when the user has written something into the field..
Bjarne, Dirk is correct. The error message is used for all invalid inputs. This might not be ideal for everyone but it is a simple solution. One suggestion would be to write an error message such as "Please enter a valid email."
I will consider this enhancement for future releases.
I might be possible to do something like the RequiredFieldValidator and RegularExpressionValidator does, as they both generate some javascript to validate the input fields..
Error message if regex doesn't match
Hi..
Is is possible to specify another error message if the regex doesn't match, e.g. "The input isn't a valid e-mail address"?
Just like the ASP.NET RegularExpressionValidator , where the RequiredFieldValidator is used to check whether the field is empty or not.
Here it just use the same error message for blank fields and wrong input.
Bjarne
I don't think so, the regex validator is used for all content, regardless of what type of content needs validation. So, no, but could provide some help info (can be set for each prop) for your users to make sure they enter valid data from the first time. Defo not a solution, but it would work.
Cheers,
/Dirk
Okay..
the validator use the regex for the e-mail field.. and it might be using some other function to check if a field is blank?
anyway it would be more appropriate to have a error message saying, that it isn't a valid e-mail address instead of "please enter your e-mail" when the user has written something into the field..
Bjarne
Bjarne, Dirk is correct. The error message is used for all invalid inputs. This might not be ideal for everyone but it is a simple solution. One suggestion would be to write an error message such as "Please enter a valid email."
I will consider this enhancement for future releases.
Okay.. yes that could be a workaround temporary.
I might be possible to do something like the RequiredFieldValidator and RegularExpressionValidator does, as they both generate some javascript to validate the input fields..
is working on a reply...