Copy link to clipboard
Copied
Can someone PLEASE, tell me where the error is in my code;
Here is the error:
SyntaxError: missing ] after element list
1: at line 2
Here is the code:
var fieldsToLock =["Name", "Student#:","Email:", "Phone#:", "Reference#:", Authorized by:", "Approved Amount","Approved Items:", "Price"]
[for (var i in fieldsToLock) this.getField(fieldsToLock[i]).readonly = true;]
I can't figure it out!
Thank you!
Copy link to clipboard
Copied
Hi,
This line does not need to be in [] .
[for (var i in fieldsToLock) this.getField(fieldsToLock[i]).readonly = true;]
I would do it like this
for (var i =0; i < fieldsToLock.length; i++) {
this.getField(fieldsToLock[i]).readonly = true;
}
This covers agianst older versions of Adobe Acrobat and Reader being used.
Regards
Malcolm
Copy link to clipboard
Copied
Wonderful....I was reaching beyond my skills...you saved my day. Thanks for your time.
Copy link to clipboard
Copied
You can also see a missing quote - one of the items in the list does not start with "
Copy link to clipboard
Copied
Thank you for your eagle eye finding an issue. Thank you for your time.