I have a time entry field where I have set my display pattern and edit pattern correctly to solve most cases of time that are entered. This along with the following exit code (with the help from radzmar):
if (Len($) == 3 or Len($) == 1) then
$ = Concat(0, $)
elseif (Len($) == 2 and $ >= 24) then
$ = null
endif
I can solve all of these types of entries: 623, 0623, 6:23, and 6. However, if someone decides to enter 6:23AM, my summation script can still solve it but the calculation is wrong. What code can I place in the above if statement that ensures the field has numeric values only (along with the colon)? Would this be a good opportunity for a regular expression? If so, how?
I have to admit, I had an easier time with this particular problem in my own projects since all of my users are accustomed to using military time, so I simply made the input field numeric only, and changed the display to automatically provide the colon.
Hope that helps!
DaveyB
LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB