Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Applying default values only if another field has been filled

New Here ,
May 03, 2021 May 03, 2021

Copy link to clipboard

Copied

Hello,

 

I'd like to apply the default values in a form field only if another field has been filled (almost sounds like a tongue twister)

 

For example, if I have a form with several rows of Date, Description, Price and the Description nearly always needs to be exactly the same I'd like it so when I add a date, the description is automatically filled with the default values, but otherwise if there is not date it appears blank unless manually filled.

 

Is there any way to accomplish that, perhaps using custom format?

 

TOPICS
JavaScript, PDF forms

Views

184

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

correct answers 1 Correct answer

Adobe Community Professional , May 03, 2021 May 03, 2021
As validation script of "Date" field you can use something like this: if(event.value == "") this.getField("Description").value = ""; else this.getField("Description").value = "Description goes here"; Change "Description" field name if neccessary.

Likes

Translate

Translate
Adobe Community Professional ,
May 03, 2021 May 03, 2021

Copy link to clipboard

Copied

As validation script of "Date" field you can use something like this:

if(event.value == "")
this.getField("Description").value = "";
else this.getField("Description").value = "Description goes here";

Change "Description" field name if neccessary.

 

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 ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

LATEST

Thank you Nesa, worked perfectly!

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