Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How do it force a user to enter a time in a date time field??

Avatar

Level 3

I am new to live cycle, not to acrobat pro. I must say live cycle is pretty cool and i may just switch to live cycle forever...


But i can not figure this out. I have a HR form. I need to make the time of occurence field, required, validate and wont let you move on until you enter a time.


Right now it functions as required, it shows a custom message, but the user can enter garbage text and skip through. How do i set up this field where the user can only enter a time and not skip through??


I am sure this is rather easy, i just dont know where to start.. Thanks in Advance

6 Replies

Avatar

Former Community Member

If you make it a Date and Time field a calendar will popup and the user picks the date from the calendar. They cannot enter garbage. If you make the field mandatory they will not be able to submit the form until the field is filled out. If that is not enough and you want to force the entry when they tab into the field, you coudl write script on the exit event that will not allow them to get off of the field until they complete it.

Make sense?

Paul

Avatar

Level 3

Hi Paul:

That completely makes sense... Only problem what would or could the javascript be??

I have already inserted some for the save as and print buttons sucessfully

BTW in my form the time/date field is selected and to format to show time only. In my other date fields is does show a calendar after you hit the little arrow and the user can still insert garbage.

What i would ultimately want is for the user not to insert garbage and forcing them to insert a time in the time field.

It is possible that i forgot or missed a step being as im new to Live Cycle.

Avatar

Former Community Member

Nope you didn't miss anything .....you wil have no choice but to write script on the exit event to check what the user ntered and validate it before moving on.

Paul

Avatar

Level 3

Do you happen to know the script?? I dont know javascript well enough to write it...

Avatar

Former Community Member

You woudl need a reg expression to test the format of what was entered. I am not very familiar with reg expressions but maybe some of the other programmer types can help out. P.S. You haven't stated the format that you will accept.

Paul

Avatar

Level 10

If you're looking for regular expressions you should check out http://regexlib.com/.

But a lot of regular expressions are often very verbose and pretty hard to understand.

You can try to make the date/time input more comfortable for the users, by using a set of edit pattern, which will convert the input into a desired format.

Here's a thread with some sample patterns: http://forums.adobe.com/message/3582785#3582785