default text for calendar dropdown

New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Hoping the hivemind can help a brother out.

We have calendar dropdowns on a PDF form.

Higher command want to have the facility to type 'Unknown' into the field controlled by the dropdown calendar (or have 'Unknown' as a default, which is then replaced by a date selection when the dropdown is activated).

Is there a way to do this?

If there is, it's not immediately apparent ...

Many thanks etc

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

126

Likes

Translate

Translate

Report

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
Adobe Employee ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Hi Munky.gybbon 

 

Hope you are doing well and sorry for the trouble. As described you want to type 'Unknown' into the field controlled by the dropdown calendar.

 

It is possible with the help of JavaScript. FOr more information about using JavaScript please check out the help article https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_developer_guide.pdf and see if that works

 

Regards

Amal

 

 

Likes

Translate

Translate

Report

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
New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Thanks for the link, it's probably helpful.

Which section should I be looking at?

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

I'm afraid it's not possible. The calendar widget only appears if the field's Format is set to Date, but that means you can't enter some other arbitrary string (such as "Unknown") into it. So you have to choose one or the other. If you can live without the calendar widget you can still write code to validate the user's input and make sure it's a valid date.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

LATEST

Little tip:

 

- Place the word "unknown" as a static layout text, under the Date field with a Transparent fillColor.

 

- Use the onFocus action to place a script that will turn the fillColor to white when the field is clicked, so it will hide the word "unknown":

event.target.fillColor = color.white;

 

- Use a Validation script to revert the fillColor to Transparent if the field is not filled by the user.

if (event.value.toString().length == 0) {event.target.fillColor = color.transparent;}

 

Likes

Translate

Translate

Report

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