Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Javascript New Line not working

  • 1.  Javascript New Line not working

    Posted Jun 22, 2020 09:53 AM
    I cannot get a new line to work on my JavaScript. I'm trying to pass some information to the description field on the email form and the new line just isn't working. I even tried a very simply piece of Javascript on form load to test it and still can't get it to work, every time it loads with only one line.

    What am I doing wrong?

    test = function()
    {
    Xrm.Page.getAttribute("description").setValue("Otis \r\n Buford");
    }

    ------------------------------
    Matthew Skowron
    HUB Industrial Supply
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: Javascript New Line not working

    TOP CONTRIBUTOR
    Posted 5 days ago

    Have you tried using string literal?

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals



    ------------------------------
    Rex Kenley Tan, MCSA, MCSD
    Minneapolis MN
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role