Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Format Date Field WITHOUT the Date Picker

Community Beginner ,
Jan 24, 2022 Jan 24, 2022

We have a lot of fillabe forms that we are converting from LiveCycle to Adobe DC.  The date fields, no matter which formatting is chosen, always adds the Date Picker.  We need to be able to remove this option from Date of Birth fields.  I have tried just using the JavaScript to format the fields but it automatically changes to the date field formatting instead.

Any suggestions?

Thanks!

TOPICS
How to , JavaScript , PDF forms
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jan 25, 2022 Jan 25, 2022

Don't use the Date format and use this script as a Validation script, you can edit the format (yyyy-mm-dd) as you like:

 

// VALIDATION SCRIPT
var d = util.scand("yyyy-mm-dd", event.value);
if (d == null) {
app.alert("Please enter a Date at the yyyy-mm-dd format.");
event.rc = false;
}


Acrobate du PDF, InDesigner et Photoshopographe

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2022 Jan 24, 2022

What is the issue with the Date Picker?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 24, 2022 Jan 24, 2022

Our division heads do not want users to just click on it instead of actually entering a date of birth. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2022 Jan 24, 2022

OK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2022 Jan 24, 2022

No, you can't disable it. If you don't want it to appear don't use the built-in Date format. You can achieve the same results using a custom Format script, and then the Date Picker won't appear.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 25, 2022 Jan 25, 2022

When I use a custom JavaScript format field, it automatically goes back to Date Format.

Go into Field Properties
Click Format
Choose Custom
Enter the JavaScript for Keystroke

Click ok....

the format shows as 'Date' and not custom anymore.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2022 Jan 25, 2022

What code are you using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 25, 2022 Jan 25, 2022

this.getField("YOURFIELDNAME").value = util.printd("mm-dd-yyyy h:MM tt", new Date());

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2022 Jan 25, 2022
This is not a Format script.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 25, 2022 Jan 25, 2022

Sorry sent wrong one. that was for my default date.

new Date().toLocaleDateString('en-us', { weekday:"long", year:"numeric", month:"short", day:"numeric"})

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2022 Jan 25, 2022

Don't use the Date format and use this script as a Validation script, you can edit the format (yyyy-mm-dd) as you like:

 

// VALIDATION SCRIPT
var d = util.scand("yyyy-mm-dd", event.value);
if (d == null) {
app.alert("Please enter a Date at the yyyy-mm-dd format.");
event.rc = false;
}


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 25, 2022 Jan 25, 2022
LATEST

This works perfectly ... Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines