Expand my Community achievements bar.

SOLVED

Force use of date-picker

Avatar

Level 3

Hi Everyone,

Is there a way to force the user to use the date-picker and not type?

I want the user to enter the date only with the date-picker. I do not want him typing at all.

Can it be done?

Many, many Thanks,

Joe

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Joe

I got this to work by putting the following in the change event

if (xfa.event.change.length==1)

xfa.event.change = "";

I then added a note in the enter event to advise users to click on the arrow to do this

xfa.host.messageBox("Please click the arrow to your left to select date","Assistance",3)

I am not sure that the code is that great but works for me.  Bear in mind that some users cannot use a mouse which would be the disadvantage of doing this force.

Let me know if it works.

Thanks

Darren

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

Hi Joe

I got this to work by putting the following in the change event

if (xfa.event.change.length==1)

xfa.event.change = "";

I then added a note in the enter event to advise users to click on the arrow to do this

xfa.host.messageBox("Please click the arrow to your left to select date","Assistance",3)

I am not sure that the code is that great but works for me.  Bear in mind that some users cannot use a mouse which would be the disadvantage of doing this force.

Let me know if it works.

Thanks

Darren

Avatar

Level 3

Hi Darren,

Thanks. This does the job.

I think I might put that message onto a bit of text to the right of the field...something like...  "How to enter the date." This way the user will not be bothered constantly by the message.

I neglected to mention that my user population is a fairly stable group and they will be using this form repeatedly. So, I don't want them to hate me for constantly showing that message, but I do want it there for occasional new users.

Excellent. Inventive.

Thanks,

Joe