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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text fields 1

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
Is there any way I can make PHP/MySQL recognise the fact that there are paragraphs in a text field without having the user put in <p></p> or <br> tags in to format it?
 
I don't think that really helps me as the user would still have to type /n

Really I want something like the text boxes on here where I can press return and the page will recognise the fact that I've done it without me having to type <br> or /n
 
Not really. \n is actually a carriage return, meaning that when user pushes enter, they insert \n and using the nl2br function will transfrom that into <br />. Now, it won't know when to put <p></p> but it will put <br /> in every occurence of enter making the text entered in say textarea look the same in html. Another option to preserve similar formatting to textarea is embedding text in <pre></pre> tags.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top