Forum Moderators: coopster

Message Too Old, No Replies

Text Area Variables

text area variables does not display correctly.

         

d40sithui

4:04 pm on Jul 20, 2007 (gmt 0)

10+ Year Member



hi guys/gals,
i have a form with a <textarea> tag.
as you all know in text areas, you can hit enter and youll get to a new line. when submiting the form, the action script will check for errors and display values in the fields that were entered in the previous page.
in the text area, if you used the enter key to skip to a new line it'll display something like "\r\n" followed by the value itself. is there a way to clear that?heres what i have exactly

echo"<td align=left><textarea cols=40 rows=10 name=\"new_course_desc\">".htmlentities($new_course_desc)."</textarea></td>\n";

d40sithui

5:12 pm on Jul 20, 2007 (gmt 0)

10+ Year Member



ok got the problem sorted out.
used the function str_replace('\r\n', ' ', $string);
just in case anyone was wondering

jatar_k

5:25 pm on Jul 20, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you may even want to change them to <br> if you wanted to display the data in a certain way with linebreaks intact