• jouster
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Hello,

 

I have a button with on click javascript attached to it. I am using this to make sure a custom comment field is filled out before sending to my custom apex page. The problem is if the user hits the enter key in the comments then I get an on click javascript error stating there is a unterminated string. Anyone else have this problem? Any ideas on how to get around this?

 

Here is the code:

 

var comments;

comments="{!Case.Convert_To_Lead_Comments__c}";

if(comments==null || comments=="")
{
alert("Please enter comments into Convert To Lead Comments section!");
}
else
{
window.location= "/apex/ConvertCaseToLeadButton?id={!Case.Id}";
 }

Writing a c#.net program and I get this error on my server, but not my local machine. Any ideas on why its different?

 

Here is the line of code in question:

 

opp = (Quote)qr.records[i];

 

Thanks.