How can i insert <Br> and <p> in a textarea..... Like many forums... Likely with a simpley code.. Thanks..Benson
Use nl2br(). It converts new lines (\n) to "<BR/>\n". For <P>, just remember that it is equivalent to <BR/><BR/>, so 2 new lines (a new paragraph) will be "<BR/>\n<BR/>\n".
Can't it be done with a simpel button like in the phpBB 2 forum... there you can push a button named [br] and then the code will be inserted into the textarea...
Jue make some javascript...
function Add_Br() { var theTextarea = document.forms["myForm"].myTextarea; theTextarea.value += "<BR/>\n"; }
myForm is the name of the form and myTextarea is the name of the textarea...