Display format must align to the value inside the input field (when mouse is inside the input field)
Copy link to clipboard
Copied
Hello,
Can anyone help me with my issue:
For the Date Picker, I have option to fill out this field, either thru date picker or thru manual key in
For Date Picker, there is no issue since the selected date is automatically formatted to 'dd mmm yyyy'.
For Manual key-in, the user can input any other date format such as dd/mm/yyyy or dd-mm-yyyy, which I managed to handle and apply date format into 'dd mmm yyyy' however when you focus on the mouse inside the input field the value is still dd/mm/yyyy. I want to render the value (when the mouse is inside the field) into same as how it is displayed dd mmm yyyy.
Manual key-in
If the mouse is away the field, it renders to the correct format
But when you go back inside the field, it's still dd/mm/yyyy
Thank you in advance for the help.
Copy link to clipboard
Copied
When you try to leave the field in Preview Mode or Reader through clicking or tabbing, are you getting a validation warning like the below (note that I chose the default dd-mmm-yyyy format for field rather than your non-hyphenate version)?
Copy link to clipboard
Copied
Hello Pariah,
There is no warning. By right, formats such as dd/mm/yyyy and dd-mm-yyyy are also acceptable, then I used custom script to format them to dd mmm yyyy as shown in the picture. However, when you focus the mouse inside the field, it's still dd/mm/yyyy instead of dd mmm yyyy
Copy link to clipboard
Copied
Ah. You wrote a custom script. If you remove the script, does it work?
If yes, then please provide the script here. Hopefully someone versed in Javascript for Acrobat can help.
Copy link to clipboard
Copied
A format script changes the way the value of the script looks, but not the actual value itself. So when the user enters the field (to edit the value) it shows the original value it has, not the formatted version. Therefore, if they entered the date dd-mm-yyyy, that's what will be shown when they go back to edit it later on. The calendar wizard applies the selected date in the actual pattern you selected, so there's no change when you go to edit it later on.

