You are viewing limited content. For full access, please sign in.

Question

Question

MM/YY field constraint

asked on October 27, 2014

I am adding a template field for data entry of MM/YY by the user. How can I add a constraint that validates that the entry of the month portion is between 01-12?  Thanks!

0 0

Answer

APPROVED ANSWER
replied on October 27, 2014

If your field type is a date, you could change the field format to Custom and enter "MM/YY".  This formatting will be automatically applied to any valid date entered into the field.  

If you're using a regular expression, you'd use the following to constrain input from 01-12:

0[1-9]|1[012]
0 0

Replies

replied on October 28, 2014

I will be using a regular expression. Your solution works great. Thanks.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.