Skip to main content
Participant
May 15, 2024
Answered

How to automatically change numbers (05152024) to date format (05/15/2024) in Adobe forms

  • May 15, 2024
  • 2 replies
  • 1027 views

Hey Adobe Community!!! Thanks for always taking the time for people like me who don't know anything! 😉

How do I make numbers automatically change to date format Adobe forms?

 

For example typing: 05152024 I want it to automatically change to 05/15/2024 format


I already did the "change the "Format" tab in the properties to Date format.. I'm in the tab where I need to make it a "custom " format.
I want to know if there is a "code" or some script to make it auto-populate to date format.

Also is there a way to have a text field box automatically set it to be today's date?


Thanks a lot for all your help, time, and knowledge in advance!

This topic has been closed for replies.
Correct answer Nesa Nurani

Try this as custom format script:

var input = event.value;
if (/^\d{8}$/.test(input)) {
var month = input.substring(0, 2);
var day = input.substring(2, 4);
var year = input.substring(4, 8);
        
event.value = month + "/" + day + "/" + year;}

2 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 16, 2024

Try this as custom format script:

var input = event.value;
if (/^\d{8}$/.test(input)) {
var month = input.substring(0, 2);
var day = input.substring(2, 4);
var year = input.substring(4, 8);
        
event.value = month + "/" + day + "/" + year;}
Participant
May 16, 2024

YOU ARE THE BEST!!!!!!!!!!!!! THANK YOU!!!!!!! That worked!!!! 

 

Also, Is there a script for automatically generating the date when they fill out the form and then maintaining that specific date once signed?

 

Participant
May 16, 2024

Still lost with this. Please advise!