2 Replies Latest reply on Feb 27, 2015 12:24 PM by progravix

    How do add a new line in the JavaScript Editor?

    progravix

      I have a script like this:

       

      var n = this.getField("score").value;

       

       

      if (n >= 0 && n < 5) {

          event.value = "The WP 100% Bond\nThe WP 10% Stock / 90% Bond\nThe WP 20% Stock / 80% Bond";

      }

      I want to output that line like...

       

      The WP 100% Bond

      The WP 10% Stock / 90% Bond

      The WP 20% Stock / 80% Bond

       

      But it's not honoring the \n for a new line. How in the heck do you add a new line??? I've tried \r, \r\n, \n\n. All it does is add a character space, and looks like this...

       

      The WP 100% Bond The WP 10% Stock / 90% Bond The WP 20% Stock / 80% Bond