PDA

View Full Version : Preserving Line Breaks in Input Field


worm
03-20-2003, 06:18 PM
Hi guys,

When I press enter in my input text field to create a new line, it looks OK in Flash, but when it gets stored in my MySQL database, it's all combined into a single line, so when it gets reloaded into Flash, it loses its formatting. What could I do to overcome that?

Thanks :)

CyanBlue
03-20-2003, 08:59 PM
Howdy and Welcome... ;)

I think that is happening because the carriage return character is not set right when you press ENTER key within the input box...

Maybe there are other ways to solve this, but the only thing I can think of at the moment is to cycle through the input text to look for the carriage return and replace it with '\r\n' before you send the data to the backend... Or, have a key listener running while the user is typing and when the ENTER key is detected, you can do the replace there rather than going through the whole string at the end... Just my 2 cents... ;)