Announcement

Collapse
No announcement yet.

Line break in InvoiceName variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Line break in InvoiceName variable

    I am trying to set some javascript variables to their corresponding Actinic variables on my receipt page. Most of the variables are working, but the InvoiceName variable is causing a problem because when it is written out, it puts a line break at the end of the value. This causes problems in the javascript because it causes a line break in the middle of the string. My layout code looks like this:

    var name = '<actinic:variable encoding="perl" name="InvoiceName" selectable="false" />';
    var address1 = '<actinic:variable encoding="perl" name="InvoiceAddress1" selectable="false" />';

    When the page is rendered, the html source code looks like this:

    var name = '&#32;John&#32;Doe<BR>
    ';
    var address1 = '123&nbsp;West&nbsp;Ave<BR>';

    Notice how there is a line break after the first line.

    Does anyone know how to fix this? I tried different encoding types for the variable but none of these do the trick (and some of them don't work). Is there a different variable I can use.

    Any help would be appreicated.

    #2
    Derek,

    Welcome to the community.

    The <BR> you mention comes from the scripts.

    Edit 'OrderScript.pl' with notepad..

    Search for 'Build the receipt' ( without quotes)

    Then search for '$sInvoiceName', it should come up with this highlighted, hit next on the search and you should see...
    $sInvoiceName .= $Response[1] . "<BR>\n"; # add it to the message display
    Remove the <BR> and save the file. A copy of the original file can be found in the 'Original' folder.

    Kind regards,
    Bruce King
    SellerDeck

    Comment


      #3
      It looks like that \n should be removed too.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment

      Working...
      X