how can I check for a regular expression (email) and make sure the field in a form is non-empty at the same time?
if I leave it to regular expression only, it accepts empty strings
if I place two validators, it takes the space for two labels, and sometimes both errors show next to each other, i only want one label for the error
thanks!
how can I check for a regular expression (email) and make sure the field
Share
Use a
RequiredFieldValidatorand theRegularExpressionValidatorand setDisplaytoDynamic, then it won’t take two spaces.In general it’s a good idea to use two validators because you can provide two meaningful error-messages (“Please enter email” or “… must be a valid email”).