Hey getting SyntaxError: missing ; after for-loop initializer.

New Here ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

Hey yall im getting the above error when trying to execute the following for loop.

 

var prodLength = product.length;
for(let i = 0; i < prodLength; i++) {
    if (product[i][5] > 0) {
        if(quPn1.length <= 0) {
            quPn1 = product[i][1];
        } else if(quPn1.length >= 0) {
            if(quPn2.length <= 0) {
                quPn2 == product[i][1];
            } else if(quPn2.length >= 0) {
                if(quPn3.length <= 0) {
                    quPn3 == product[i][1]
                }
            }
        }
    } else if (product[i][5] <= 0) {
        // code
    }
};
 
product is a 2d array of variables refrenced to text fields eg.
const product = [
        [caPn1,caDsc1,caWe1,caUp1,caVol1,caTot1]
        [caPn2,caDsc2,caWe2,caUp2,caVol2,caTot2]
 
var caPn1 = String(this.getField("CaPn1").valueAsString);
var caPn2 = String(this.getField("CaPn2").valueAsString);
The end goal of the for loop is to loop through the 2d array checking for values greater than 1 in the fifth element of the interior array and if a value is seen to check a text field for text and if it is empty fill it with an element from the array. Thanks ahead of time for your help!
 
 
 
TOPICS
JavaScript , PDF forms

Views

39

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

correct answers 1 Correct answer

Adobe Community Professional , Jul 15, 2022 Jul 15, 2022

Replace let with var

Likes

Translate

Translate
Adobe Community Professional ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

LATEST

Replace let with var

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