2 Replies Latest reply on Feb 10, 2011 6:59 PM by Jo_2005

    Getting the last value from a multiline text box

    Jo_2005 Level 1



      I have an acro form with a multiline text box, some radio buttons and text fields.


      When the radio button is clicked, the value from the multiline text box is shown in another text field.


      This is the script for the radio button :

      //Target Field
      var t = this.getField("Action Agenda");


      //Value Field

      var g = this.getField("Agenda Item").value;

      t.value  +=  g + "\n" ;




      What the script does is show ALL of the values from the multiline text box "Agenda Item" into the other text field "Action Agenda".


      I need the script to extract the last line or entry from the multiline text box and place this value into the other text field.  There could be any number of lines from a single line to two, three, four lines etc.


      Can any one please advise how the script can be modified to get the value for the last line in the multiline text box?


      Any help will be most appreciated.