Skip to main content
New Participant
April 16, 2025
Question

Display format must align to the value inside the input field (when mouse is inside the input field)

  • April 16, 2025
  • 2 replies
  • 433 views

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. 

 

2 replies

try67
Community Expert
April 16, 2025

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.

Pariah Burke
Community Expert
April 16, 2025

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)?

 

 

 

 

New Participant
April 16, 2025

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

Pariah Burke
Community Expert
April 16, 2025

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.