[Resolved] Help to force MM/YYYY with regex
I am implementing Fast Secure Contact Form to collect registration forms for a conference. I have included a membership expiration date field, and want registrants to be able to input ONLY MM/YYYY (that exact format, with slash, and that number of digits. This way, when exported to our database the formatting is consistent).
I wrote the following regex to accomplish this, with the intention of adding it to the ‘validation regex’ field:
When I test this regex in an external validator, it works fine, accepting and only accepting the desired date format. But it does not work in the form, and returns the fail message upon form submission. I am implementing several other expressions elsewhere in the form (limiting fields to digits only, etc) which are working properly.
Any ideas on what I am doing wrong? If we can’t force the desired format it’s not the end of the world, but it will save my colleague a lot of time in reformatting our database later. I’m a newbie so perhaps the solution is glaringly obvious. I would appreciate any assistance. Many thanks!
- The topic ‘[Resolved] Help to force MM/YYYY with regex’ is closed to new replies.