2 Replies Latest reply on Aug 29, 2012 5:43 AM by rbyond

# Sum one Field based on another's input

I have a question. Is it possible to have a specific field populated with specific number based on the input of antother field. Example.  In Field #10  I have to input a number.  If the number is 1-365 it's an ( F) If the number is 366- 392 it's an ( D) if it's 393-460 its an (C) if it's 461-500 it's an ( B) if 501-700 it's an (A).  So In Field  #11  I want that to populate the Letter based on the input of the number input in field#10.  Is that possible in Javascript or How?

Thank You in Advance

• ###### 1. Re: Sum one Field based on another's input

Sure it's possible. The custom Calculate script for the text field could be:

(function () {

// Get the field value, as a number

var val = +getField("Text10").value;

// Set this field's value

if (val < 366) {

event.value = "F";

return;

}

if (val < 393) {

event.value = "D";

return;

}

if (val < 461) {

event.value = "C";

return;

}

if (val < 501) {

event.value = "B";

return;

}

if (val < 701) {

event.value = "A";

return;

}

// Default

event.value = "";

})();

• ###### 2. Re: Sum one Field based on another's input

Thanks George! That got me back on Track!! awesome