2 Replies Latest reply on Nov 25, 2010 1:38 PM by Jo_2005

    Count the number of carriage returns in a multiline text box

    Jo_2005 Level 1

      Hello,

       

      I have a script to count the number of carriage returns at the end of each line of text in a multiline text box.

       

      After running the script in the console, the result keeps showing as 0.

       

      Can anyone please advise how the script can be revised to count the number of carriage returns?

       

      var count = 0;
      for (var i = 0;  i < this.getField; i++)
      {
      var f = this.getField("ActionAgenda");
      if (f.value =="\u000d") count++
      }
      console.println("There are a total of "+ count + " carriage returns.");

      Any assistance will be most appreciated.