New Responsive - Input Field Validation for Time Field

  • 30 March 2022
  • 4 replies

My client wants a "time" field, separate from a date/time field where the user will type in the mm:ss am/pm.  I think the "Input Validation" will help with this.  But I am having trouble figuring out how to configure either the "Text Mask" or the "Regular Expression".  I'd like the validation to enforce a 1 or 2 digit hour, a colon, a 2 digit minute and a required AM or PM.

For example  05:30 AM  or 12:15 PM

Also,  Is there a link that explains "Text Mask" or "Regular Expression"? 


Best answer by MeganGo 31 March 2022, 07:44

View original

4 replies


This works perfect in Regular Expression.  Thank you!

@MeganGo You helped me with a field validation for time.  Now I need one for a date.  My customer does not want to use the date widget that comes along with a date field because the dates can be 30 or 40 or more years back.  So, I thought I'd provide a text field with a date validation. It needs to be in Year, Month, Day order with a required 4 digit year, 2 digit month and 2 digit day so that the field can be sorted.   Something like YYYY/MM/DD , ui.e. 1950/05/01.  The year can go back as far as 1900.   Can you help me with a field validation that will do this? 

I found an input validation that will check for YYYYMMDD. It works with and without dashes and for any year. For consistency, it would be nice if it either worked with dashes or no dashes, but not both. I do not know or understand regex enough to modify it: