Need help creating a script to display the maximum value from one field in another field

johnt36490185

25-09-2020

Greetings,

This is my first post and I am a novice with javascript and form calc, but I have a form with a dynamic, expanding table with a sum field at the end. I've got everything working they way I'd like, but the person I'm developing this for wants to see a field be automatically populated with the maximum value from this field. I'm at a loss and would really appreciate the help. Again, I am new here. Is there a way I can post the form for someone to review? Thanks!Screen Shot 2020-09-25 at 10.18.52 AM.png

Accepted Solutions (1)

Accepted Solutions (1)

Mayank_Gandhi

Employee

25-09-2020

@johnt36490185  You can put the script on an exit event. Loop through the table values and read value of cell-like xfa.resolveNode("MyTable.Row1[" + i + "].txtName").rawValue;

keep the value obtained in the last cell in a variable and check inside the loop if the value in the next cell is bigger replace the current value with a bigger value else keep it same. At the end of loop, the largest value will be in the var.

Answers (0)