Skip to main content
Participant
November 4, 2023
Question

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

  • November 4, 2023
  • 1 reply
  • 457 views

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

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
November 4, 2023

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 = "";