getting error in JavaScript

Explorer ,
Dec 12, 2017

Copy link to clipboard

Copied

hi, i'm getting "SyntaxError: missing ; before statement" error in bellow code. can u pls help me to solve this issue. thanks..

var s1 = getField("aa").valueAsString;

var s2 = getField("bb").valueAsString;

event.value = "THIS AGREEMENT (the "Agreement") is made on" + s1 + ", by and between Sterling & Pope Publishing Corp, DBA, and hereafter referred to as, "The Painting Pro Guys" ('Master Licensor'), 7462 Chinaberry Lane, Frisco, Texas 75033 and " + s2 + " , of Texas, on the basis of the following understandings and agreements:" ;

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

If you want to include double-quotes within a string that's delimited by such quotes you have to escape them, like so:

var myString = "This string contains \"double-quotes\".";

TOPICS
Acrobat SDK and JavaScript, Windows

Views

75

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

getting error in JavaScript

Explorer ,
Dec 12, 2017

Copy link to clipboard

Copied

hi, i'm getting "SyntaxError: missing ; before statement" error in bellow code. can u pls help me to solve this issue. thanks..

var s1 = getField("aa").valueAsString;

var s2 = getField("bb").valueAsString;

event.value = "THIS AGREEMENT (the "Agreement") is made on" + s1 + ", by and between Sterling & Pope Publishing Corp, DBA, and hereafter referred to as, "The Painting Pro Guys" ('Master Licensor'), 7462 Chinaberry Lane, Frisco, Texas 75033 and " + s2 + " , of Texas, on the basis of the following understandings and agreements:" ;

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

If you want to include double-quotes within a string that's delimited by such quotes you have to escape them, like so:

var myString = "This string contains \"double-quotes\".";

TOPICS
Acrobat SDK and JavaScript, Windows

Views

76

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
Dec 12, 2017 0
Most Valuable Participant ,
Dec 12, 2017

Copy link to clipboard

Copied

If you want to include double-quotes within a string that's delimited by such quotes you have to escape them, like so:

var myString = "This string contains \"double-quotes\".";

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
Reply
Loading...
Dec 12, 2017 1
omanbux LATEST
Explorer ,
Dec 12, 2017

Copy link to clipboard

Copied

thanks a lot. now my code working perfectly. thanks again..

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
Reply
Loading...
Dec 12, 2017 0