Skip to main content
Participating Frequently
October 9, 2018
Answered

Javascript Syntax error

  • October 9, 2018
  • 1 reply
  • 2502 views

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."});
This topic has been closed for replies.
Correct answer try67

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 .

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 9, 2018

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 .

Participating Frequently
October 9, 2018

Awesome thanks!!