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

I have 4 off fields that have to be filled in with numerical data. All the fields need to to have less than 20, when they are less than 20 each ,a fifth field is filled in automatically with Pass otherwise the fifth field has fail writen into it

New Here ,
Mar 22, 2017 Mar 22, 2017

Hi,

I have written a script to auto populate a 5th field, I have 4 fields each with less that 20 to be put into them, if all 4 fields have less that 20 (each) then the 5th field is populated with Pass, if any of the 4 fields have more that 20 in it then the 5th field is populated with fail.

I works sort of because if I change the value of var d then I can get pass or fail into the 5th field, if I change any of the other fields there is no change to the 5th field

Can someone help, please

var a = getField("450").value;

var b = +getField("350") .value;

var c = +getField("250").value;

var d = +getField("stroke end0").value;

if (a,b,c,d<=20) {

event.value = "Pass";

} else {

event.value ="Fail";

}

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows
356
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

correct answers 1 Correct answer

Community Expert , Mar 22, 2017 Mar 22, 2017

Replace this line:

if (a,b,c,d<=20) {

With this:

if (a<=20 && b<=20 && c<=20 && d<=20) {

Translate
Community Expert ,
Mar 22, 2017 Mar 22, 2017

Replace this line:

if (a,b,c,d<=20) {

With this:

if (a<=20 && b<=20 && c<=20 && d<=20) {

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
New Here ,
Mar 23, 2017 Mar 23, 2017
LATEST

Hi try67,

Thank you ! struggled for days with that.

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