• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Scripting Issue

Participant ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

I've come along way with my programming of Javascript in Acrobat for forms and still have A LONG way to go!  I am not an expert, but always looking to improve.  I get overwhelmed if it gets too complicate but I have noticed my programming knowledge is growing as I overcome obstacles.  Can anyone help me with a scripting issue? 

Here is my current situation:

My goal is to allow the person filling out the form to make 2 manual entries based on a value.  Line #16 is the value.  Line #17 and #18 are manual entries that no matter what they enter on each line will give the result on line 16.  I'd like to be able to program as simple as possible (since my knowledge is simple) as script that if i make an entry on Line #17 then #18 will automatically populate the difference to equal to Line #16.  On the flip if I decide to make an entry on Line #18 then #17 will populate the difference to equal Line #16.  This needs to be this way not knowing which line the user will fill in first (#17 or #18).  Below is what I've programmed so for but I'm stumped. 

Line #16 on my form yields a number that could be positive or negative (it doesn't matter).  This number will change depending on who is filling out the form but this result will always be the basis for the formulas on other lines.

Line #17 on my form is entry made by whoever is filling out the form.  I wrote a formula for this line as follows:

var theField = this.getField("TF128");

var theValue = theField.value;

if (theValue > 10.00) {

    this.getField("TF129").value= (theValue);

}

else {

     this.getField("TF129").value="";  

}

Line #18 on my form is also an entry made by whoever is filling out the form.  I wrote a validation formula to limit an entry based on the static number for Line #16 as follows:

var a = this.getField("TF128").value;

if (event.value > a)event.value="";

else event.value;

Thank you and I sincerely appreciate any advise or direction with this!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

226

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
community guidelines
Participant ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

LATEST

I figured it out!!!

Votes

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
community guidelines