Skip to main content
Participant
March 17, 2017
Question

How to apply a ghost text and a Date format at the same time?

  • March 17, 2017
  • 1 reply
  • 937 views

I placed a default format text such as YYYY-MM-DD into a field, and it disappears when I click on a field.  This is done by applying java script, but the format of that field is not fixed as yyyy-mm-dd, because I wrote the script into the Custom Format.  Therefore, the date can be typed as 2017-03-17(a) as well as 20170317(b).  I want to fix the format as (a), consistent to the ghost text.

How can I apply the Date format into the field while a default ghost test remains?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 17, 2017

Why not use the built-in Date option under the Format tab? Select Date - Custom and then enter "yyyy-mm-dd" into the field and it will force the user to use that format.

You can then add your "ghost text" by using the On Focus and On Blur events, as I've explained here: Is there a way to add instructional text to my text field that will disappear when clicked? (PDF Forms)