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

formatting text box depending on input from another text box

Community Beginner ,
Jan 09, 2019 Jan 09, 2019

Hi

im creating a form in which i need to limit the input into a text box based on the value of another text box. for example if text box "wpds" has UB36 input into it, I then want text box "pass"  to only allow the input of "Root","Hot", "Fill" or "Cap".  But if text box "wpds" has UF49 input into it, i want text box "pass" to only allow the input of "Layer1" "Layer2" or "Layer3".  Any input into this will be greatly appreciated. thanks

TOPICS
Acrobat SDK and JavaScript , Windows
2.5K
Translate
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
Community Beginner ,
Jan 16, 2019 Jan 16, 2019

so i got the script to the point where if i ran it in the console window all it would say is undefined so i put the script that i modified in the console window into the form and now all i get is

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

 

 

TypeError: this.getField(...) is null

Translate
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
Community Expert ,
Jan 16, 2019 Jan 16, 2019

That means you specified an incorrect field name.

Translate
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
Community Expert ,
Jan 16, 2019 Jan 16, 2019
LATEST

So, the square brackets are for defining arrays and the curly brackets are for defining objects. 

The "oCountrySelection" variable is an object. so it needs to use curly brackets.

var oCountrySelection = {Canada: {list:oCanWeldProcedures},

                       "United States": {list:oUSAWeldProcedures}};

So, back to what I said in the previous posts. Start with the little bits (like this code) to make sure they are all correct and working.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
Community Beginner ,
Jan 16, 2019 Jan 16, 2019

except for this part of the list, all it says when i test this code is Undefined. which i assume means its good.

var oPassDia1 = [["-", "None"], ["1/8", "1/8"], ["5/32", "5/32"]];    

var oPassDia2 = [["-", "None"], ["3/32", "3/32"], ["1/8", "1/8"], ["5/32", "5/32"], ["3/16", "3/16"], ["7/32", "7/32"]];

var oPassDia3 = [["-", "None"], ["3/32", "3/32"]];

var oPassDia4 = [["-", "None"], ["1.1mm", "1.1mm"]];

var oPassDia5 = [["-", "None"], ["3/32", "3/32"], ["1/8", "1/8"]];

var oPassDia6 = [["-", "None"], ["3/32", "3/32"], ["1/8", "1/8"], ["5/32", "5/32"], ["3/16", "3/16"]];

var oPassDia7 = [["-", "None"], ["1/8", "1/8"], ["5/32", "5/32"], ["3/16", "3/16"]];

var oPassDia8 = [["-", "None"], ["0.9mm", "0.9mm"], ["1.1mm", "1.1mm"], ["1.6mm", "1.6mm"], ["2.0mm", "2.0mm"], ["2.4mm", "2.4mm"]];

Translate
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