Solved

Help with syntax

Posted on 2013-12-02
7
231 Views
Last Modified: 2013-12-02
As part of a stored procedure I have this part of the code which is giving me issues. This is in an ASP/Javascript page:

-- code

var Cmdaddtocaselog__Actdetails = "0";
if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"))) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}

--  error

Microsoft JScript compilation error '800a03ea'

Syntax error

/bluedot/Intranet/Cases/Comments/e-commentemailing.asp, line 281

if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"))) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}
-----------------------------------------------------------------------------------------------------------------------------------------------^
0
Comment
Question by:amucinobluedot
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Expert Comment

by:dimmergeek
ID: 39690514
I think you have one too many closing parens in your if (test)
0
 

Author Comment

by:amucinobluedot
ID: 39690519
Can you tell which ones ?
0
 
LVL 7

Accepted Solution

by:
dimmergeek earned 500 total points
ID: 39690522
try
if(String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message")) != "undefined"){ Cmdaddtocaselog__Actdetails = String("Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message"));}

Open in new window

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:amucinobluedot
ID: 39690527
Perfect, thanks !
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39690528
you had an extra ")". I also re-wrote it for better readibility

var commentToEmail = String( "Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message") )

if ( commentToEmail  != "undefined") {

Cmdaddtocaselog__Actdetails = String( "Comment emailed to:" + Request("txt_To") + " | "  + Request("subject") + " | " + Request("Comments") + " | " + Request("message") );

}
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39690530
beat me to it :)
0
 
LVL 7

Expert Comment

by:dimmergeek
ID: 39690537
Thank you!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now