j_lainio
asked on
Datetime regExp which doesn't allow empty value
How should I modify this Datetime regular expression to check also that empty value is NOT legal (including whitespace chars)?
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9] |3[01])[- /.][0-9]{4}$
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9]
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I have to mark my own findings as an answer for my problem... sorry! ;)
Sorry but you are here exchanging with other experts findings. And you cannot keep your points because you stated wrong your question and expected wizards can read your mind and your dot.Net environment. Both Experts answered absolutely correct your question so is the points split the only choice. But I am also sure that both Experts grant the points back as a gift to you ;-)
And I am also sure that both Experts would not argue with you for points because they are too polite, therefore I am jumping in to help you getting help from them in your next question with your saved points :)
Can you see it that way?
Here also an internet page stating the ASP.NET RegExp problem:
http://authors.aspalliance.com/chapters/0672320681/0672320681_CH03.aspx
=====
.. you'll quickly discover that you can submit the form without entering any text into the text box. The RegularExpressionValidator control does not require a value.
The only way to require a value is to combine RegularExpressionValidator with RequiredFieldValidator. Nothing prevents you from associating multiple Validator controls with the same control.
======
And I am also sure that both Experts would not argue with you for points because they are too polite, therefore I am jumping in to help you getting help from them in your next question with your saved points :)
Can you see it that way?
Here also an internet page stating the ASP.NET RegExp problem:
http://authors.aspalliance.com/chapters/0672320681/0672320681_CH03.aspx
=====
.. you'll quickly discover that you can submit the form without entering any text into the text box. The RegularExpressionValidator
The only way to require a value is to combine RegularExpressionValidator
======
i think the points has to be split and the question must not be abandonned...
Thanks j! :)
ASKER
And actually I found a way (a bit stupid, but anyway) to handle problem with these asp.net controls. I will use 2 different controls to handle my validation like this:
Validate that value is NOT empty:
<asp:RequiredFieldValidato
Validate that value is in correct format:
<asp:RegularExpressionVali