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

How to auto populate one field based on the values of two other text fields

New Here ,
Nov 03, 2023 Nov 03, 2023

Copy link to clipboard

Copied

Hi friends!

 

I have a form that has a few text fields. I'm assuming once I figure this out for one field I can apply to the others. Basically, if "undefined" text field AND "undefined_2" text field are both completed with the number zero, how do I get all other fields to also populate with the number zero?

 

Thank you!

Jena

TOPICS
PDF forms

Views

99

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
Community Expert ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

LATEST

You can use something like this in a field where you wish to show zero as custom calculation script:

var u1 = this.getField("undefined").value;
var u2 = this.getField("undefined_2").value;

if((!isNaN(u1) && u1 === 0) && (!isNaN(u2) && u2 === 0))
event.value = 0;
else
event.value = "";

Votes

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