function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fullvaluefullvalue 

unterminated string literal

Hello,
I am trying to create a custom link that executes javascript.  I am getting an  "unterminated string literal" error.  The following is the only thing I have in the custom link. 

var SPSTREET = "{!Account.ShippingStreet}";

I figured out that the error occurs when the shipping street address has more than one line entered. I am using inline editing.

Any Ideas?
PawelWPawelW
You can make in head section hidden field:

textarea style="position:absolute; visibility:hidden" id="TMP_STREET">{!Account.Main_Street__c}

then get the value of this field in Javascript:

var street = document.getElementById("TMP_STREET").value;
finalistfinalist
I tried this method, but with the same result - the field does not appear to be loaded into the variable.

[head]
[textarea style="position:absolute; visibility:hidden" id="tmp_Notes"]{!Opportunity.Long_Text_Field__c}[/textarea]
[script yada-yada-yada]
var notes = document.getElementById("tmp_Notes").value;
alert(notes);
[/script]
...

As soon as there is a newline character in .Long_Text_Field__c, the page stops loading; if there is no newline, the alert pops up with the field value.