Javascript Syntax error

New Here ,
Oct 09, 2018

Copy link to clipboard

Copied

Good morning,

I am having an issue figuring out what is wrong with my java script.  I copy and pasted an old one I used (and worked/works fine), but this time it's giving me a syntax error.  Any help is greatly appreciated, I'm sure it's something simple I'm missing.  I am creating a submitable form.

It tells me "SyntaxError: missing } after property list 5: at line 6".

var DEPT = this.getField("DEPT").valueAsString;

var RQSTNAME = this.getField("RQSTNAME").valueAsString;

var PROJNAME = this.getField("PROJNAME").valueAsString;

var LEADER = this.getField("LEADER").valueAsString;

  1. this.mailDoc({cTo:"email@email.com", cSubject: "Project request for: Dept "+DEPT+" - Requestor "+RQSTNAME+" - "+PROJNAME+" - "+LEADER+", cMsg: "Please see the attached project request."});
Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

I recommend using a plain-text editor that has code coloring capabilities, like Notepad++. If you do that it will become immediately clear what the issue is. Here's how it looks like:

As you can see, the string after +LEADER+" is not closed, which screws up the rest of the line.

You can remove the last part of it entirely, so just end with +LEADER .

TOPICS
Acrobat SDK and JavaScript, Windows

Views

216

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

Javascript Syntax error

New Here ,
Oct 09, 2018

Copy link to clipboard

Copied

Good morning,

I am having an issue figuring out what is wrong with my java script.  I copy and pasted an old one I used (and worked/works fine), but this time it's giving me a syntax error.  Any help is greatly appreciated, I'm sure it's something simple I'm missing.  I am creating a submitable form.

It tells me "SyntaxError: missing } after property list 5: at line 6".

var DEPT = this.getField("DEPT").valueAsString;

var RQSTNAME = this.getField("RQSTNAME").valueAsString;

var PROJNAME = this.getField("PROJNAME").valueAsString;

var LEADER = this.getField("LEADER").valueAsString;

  1. this.mailDoc({cTo:"email@email.com", cSubject: "Project request for: Dept "+DEPT+" - Requestor "+RQSTNAME+" - "+PROJNAME+" - "+LEADER+", cMsg: "Please see the attached project request."});
Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

I recommend using a plain-text editor that has code coloring capabilities, like Notepad++. If you do that it will become immediately clear what the issue is. Here's how it looks like:

As you can see, the string after +LEADER+" is not closed, which screws up the rest of the line.

You can remove the last part of it entirely, so just end with +LEADER .

TOPICS
Acrobat SDK and JavaScript, Windows

Views

217

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
Oct 09, 2018 0
Most Valuable Participant ,
Oct 09, 2018

Copy link to clipboard

Copied

I recommend using a plain-text editor that has code coloring capabilities, like Notepad++. If you do that it will become immediately clear what the issue is. Here's how it looks like:

As you can see, the string after +LEADER+" is not closed, which screws up the rest of the line.

You can remove the last part of it entirely, so just end with +LEADER .

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...
Oct 09, 2018 1
New Here ,
Oct 09, 2018

Copy link to clipboard

Copied

Awesome thanks!!

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...
Oct 09, 2018 0