Text Area and Line Feeds
Posted: Fri May 03, 2013 5:17 pm
We have a note file that we are loading up to a text area on a PUI screen. The note file can consist of multiple line records with a text field of 50 characters. When I load the data to the text area, I am concatenating the hex code for a line feed to the end of each text field so that the text area lines up correctly with how the data was stored. The hex character I am using for a line feed is X'25'.
When I update the file from the text area I strip out the line feeds so as not to get them back into the file on the iSeries.
That all works fine. We have created button connected to a java script function that will take the user highlighted portion of the text area and strip out all formatting so the user can then place the spacing and line feeds from a fresh start.
It seems as if the line feeds are not being removed using the java script function and my java expert here was wondering how PUI would store the line feeds in the text area.
His function uses this the following to strip out out formatting:
selection.text = selection.text.replace( /(\r\n|\r|\n)+/g, " ");
The function will actually re-format the text area correctly to the naked eye but when I start reading through the text area data in my RPG in debug I can still see the line feeds in the string even if no more formatting has been done.
We want the line feeds to be stripped out so the user can reformat anew.
Hope this makes sense and someone can give us a hand.
Thanks!
When I update the file from the text area I strip out the line feeds so as not to get them back into the file on the iSeries.
That all works fine. We have created button connected to a java script function that will take the user highlighted portion of the text area and strip out all formatting so the user can then place the spacing and line feeds from a fresh start.
It seems as if the line feeds are not being removed using the java script function and my java expert here was wondering how PUI would store the line feeds in the text area.
His function uses this the following to strip out out formatting:
selection.text = selection.text.replace( /(\r\n|\r|\n)+/g, " ");
The function will actually re-format the text area correctly to the naked eye but when I start reading through the text area data in my RPG in debug I can still see the line feeds in the string even if no more formatting has been done.
We want the line feeds to be stripped out so the user can reformat anew.
Hope this makes sense and someone can give us a hand.
Thanks!