Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get the newlines out of textarea input 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a textarea on my site that has to be processed. I have to put the input in one line or the code will start a new thread. If people don't use "return" it works fine, but if they do, every newline creates a new thread.

I tried to work it out with =~ s/\n/<br>/g; to make it work with html. I also tried getting it out as %0A. It always ends up with getting newlines and <br>'s.

Can anybody help me?

Axeblade
 
try:[tt] s/[\n\r]+/<br>/g[/tt] as the field may have windows style returns... &quot;If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top