Skip to main content
Participant
August 26, 2020
Answered

If/Then statement with drop down list

  • August 26, 2020
  • 1 reply
  • 2850 views

Hello,

 

I have a table with 5 columns. Column 2 has a drop down list with options "Each", "Feet", and "N/A". I would like how to get column 5 to auto populate depending on the selection from the drop down.

1. If Column 2 = Each, then Column 5 = Column 4*Column 1

2. Else, Column 5 = Column 4

 

I have found similar posts and tried both a custom calculation and validation script but it does not work.

 

Please help.

This topic has been closed for replies.
Correct answer Nesa Nurani
  • Thank you for responding.

    There are multiple rows. I want the form field in row 1 column 5 to auto
    populate based on the other fields in row 1.
    Does that help?

You can use something like this in each row of column5 "custom calculation script":

if(this.getField("dropdown").value == "Each"){
event.value = this.getField("Col1Row1").value * this.getField("Col4Row1").value;
}

Rename fields for each row, It's basic code but it should get you there with little adaptation.

If you have any question feel free to ask.

1 reply

Saul5C65Author
Participant
August 26, 2020

Sorry, this is on Adobe Acrobat Pro DC creating a form

Inspiring
August 26, 2020

Hi, can you pls be more specific, how many rows in each column and when calculate you calculate entire column or row by row? example: when you say Column 5 = Column 4*Column 1 you mean:

col1row1*col4row1 result in col5row1

col1row2*col4row2 result in col5row2

or col1 all rows * col4 all rows result in one field in col5?

Saul5C65Author
Participant
August 26, 2020
  • Thank you for responding.

    There are multiple rows. I want the form field in row 1 column 5 to auto
    populate based on the other fields in row 1.
    Does that help?