Validation Script On Calculated Field

New Here ,
Aug 14, 2018

Copy link to clipboard

Copied

I have a field that totals a series of fields.  If the total plus another value of another field exceeds value of a third field than an alert message should be generated and the value be returned to 0.  The filed returns a false value whether the validation criteria is met or not.  Any assistance would be greatly appreciated!!!

var IDC0=Number(this.getField("IDC0").value);

var TA=Number(this.getField("TotalAward").value);

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

 
app.alert("Total of Direct and Indirect Costs Cannot Exceed the
Total Award");

   event.rc=false;

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

This line is a total mess:

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

Change it to:

if ((Number(event.value)+IDC0)>TA) {

TOPICS
Acrobat SDK and JavaScript, Windows

Views

84

Likes

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

Validation Script On Calculated Field

New Here ,
Aug 14, 2018

Copy link to clipboard

Copied

I have a field that totals a series of fields.  If the total plus another value of another field exceeds value of a third field than an alert message should be generated and the value be returned to 0.  The filed returns a false value whether the validation criteria is met or not.  Any assistance would be greatly appreciated!!!

var IDC0=Number(this.getField("IDC0").value);

var TA=Number(this.getField("TotalAward").value);

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

 
app.alert("Total of Direct and Indirect Costs Cannot Exceed the
Total Award");

   event.rc=false;

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

This line is a total mess:

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

Change it to:

if ((Number(event.value)+IDC0)>TA) {

TOPICS
Acrobat SDK and JavaScript, Windows

Views

85

Likes

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
Aug 14, 2018 0
Most Valuable Participant ,
Aug 14, 2018

Copy link to clipboard

Copied

This line is a total mess:

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

Change it to:

if ((Number(event.value)+IDC0)>TA) {

Likes

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
Reply
Loading...
Aug 14, 2018 0
New Here ,
Aug 16, 2018

Copy link to clipboard

Copied

I'm a dumbass  

Likes

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
Reply
Loading...
Aug 16, 2018 0