Skip to main content
Inspiring
June 10, 2007
Question

forced line

  • June 10, 2007
  • 5 replies
  • 347 views
I am storing the contents of a large input textfield into a mysql database. Problem is, when you force a line in the textfield, and save it it works. However the next time you save it, it adds another forced line. You save again and it will create another forced line. Is there comething I can do to prevent this?... eg... if when they save the text field... If I see a forced line, I can replace it with the flash term for a forced line, and save that in the database without the forced line but with the flash syntax for a forced line. Then when it comes to displaying the flash again it will read the flash syntax and display a forced line... get it????
thanks to any responders. J
This topic has been closed for replies.

5 replies

kglad
Community Expert
Community Expert
June 10, 2007
yes, that can occur in text files and xml files that are loaded.

i always use a stripWhiteSpace function when loading those file types:

Inspiring
June 10, 2007
Aren't there also some cases where you also could get either \r\n (or is it \n\r\) I seem to remember that I sometimes saw those as well.
kglad
Community Expert
Community Expert
June 10, 2007
you can strip line breaks and/or carriage returns using the flash string methods. they are "\n" and "\r", resp., in non-html enabled textfields.
Inspiring
June 10, 2007
sorry.. a line break.

line 1.
line 2.
(linebreak)
line4.
kglad
Community Expert
Community Expert
June 10, 2007
what is a "forced line"?