Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
What is the issue with the Date Picker?
Copy link to clipboard
Copied
Our division heads do not want users to just click on it instead of actually entering a date of birth.
Copy link to clipboard
Copied
OK
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
What code are you using?
Copy link to clipboard
Copied
this.getField("YOURFIELDNAME").value = util.printd("mm-dd-yyyy h:MM tt", new Date());
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Sorry sent wrong one. that was for my default date.
new Date().toLocaleDateString('en-us', { weekday:"long", year:"numeric", month:"short", day:"numeric"})
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
This works perfectly ... Thank you!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more