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

Applying default values only if another field has been filled

New Here ,
May 03, 2021 May 03, 2021

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
786
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 ,
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.

 

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 ,
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.

 

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

Thank you Nesa, worked perfectly!

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