Page 1 of 1

textarea post fetch problem

Posted: Fri Dec 18, 2009 3:59 am
by itsmani1
Problem in fetching data from text area....
When i enter some text in textarea like:

Hi
this is text message
thanks

but i try to fetch it using post method i get this text in one line.. how can i fix it it?

ere is my code
thank you

Code: Select all

 
if(isset($_POST["submit"]))
{
echo $_POST["shortDesc"];
exit;
}
 
 

Code: Select all

 
<textarea name="shortDesc" cols="60" rows="4" id="shortDesc"></textarea>
<br/>
<input name="submit" type="submit" id="submit" value="  Submit  " />
 

Re: textarea post fetch problem

Posted: Fri Dec 18, 2009 5:29 am
by requinix
It isn't on one line - it just looks that way because of how HTML works.

nl2br will make it look the way you expect.