Skip to main content
Inspiring
December 9, 2025
Answered

Date field value into text box

  • December 9, 2025
  • 1 reply
  • 511 views

I am looking for a date picked from a date field to be transposed into a text box, but in a different format and preferably in different boxes.

 

Date Field -

saledate: 11/19/2025

 

Text boxes-

text1: Nov

text2: 19

text3: 25

 

Is this possible?

Correct answer symone_1736

That should work just fine.  Can you post the form?

 


There was something I was clearly doing wrong yesterday, because it worked just fine this morning! I still attached the PDF for anyone seeing this in the future 🙂

 

Thanks, Thom!

1 reply

Thom Parker
Community Expert
Community Expert
December 9, 2025

There are several ways this could be done.  Here's a simple and straight forward method.

Use this script in the Custom Validation script for the date field:

// validate date entry first
if(/\d{1,2}\/\d{1,2}\/\d{4}/.test(event.value))
{
    var dtValue = util.scand("mm/dd/yyyy",event.value);
    this.getField("text1").value = util.printd("mmm",dtValue);
    this.getField("text2").value = util.printd("dd",dtValue);
    this.getField("text3").value = util.printd("yy",dtValue);
}

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Nesa Nurani
Community Expert
Community Expert
December 10, 2025

Just a small error — you’re writing all three values into text1, instead of text1, text2, text3.

Thom Parker
Community Expert
Community Expert
December 10, 2025

Good catch

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often