Goose87 Posted January 2, 2009 Share Posted January 2, 2009 Hi, I have a problem with a personal forum I have created. I needed to create it myself so it would work with my requirements. I am adding a feature to edit the text of a post that someone has created. When the edit page is loaded, it is meant to output the text into a <textarea> field. The php side technically works, but I can't get the whole thing to format properly. I have a large area of spaces (or tabs) with a return line, approximating to around 100 spaces. If I don't use the echo "$text"; in there and I put manual text in, I still get this large spaced area. I also tried ignoring the CSS code, but i STILL have the problem. If anyone has any ideas what this problem could be, could you please point me in the right direction, as I'm extremely frustrated with this problem. Kind Regards, Goose. Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/ Share on other sites More sharing options...
kenrbnsn Posted January 2, 2009 Share Posted January 2, 2009 Code? Ken Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/#findComment-728448 Share on other sites More sharing options...
Brian W Posted January 2, 2009 Share Posted January 2, 2009 Code may help because I don't get what your problem is. If you are getting spaces you aren't supposed to have, try using trim() Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/#findComment-728450 Share on other sites More sharing options...
Goose87 Posted January 2, 2009 Author Share Posted January 2, 2009 <form action="xxxx" method="post" name="edit_post"> <table cellspacing="2px"> <tr> <td bgcolor="#000" align="center" colspan="2"> Edit Post </td> </tr> <tr> <td align="center" colspan="2"> <textarea class='mail' name="body" cols="50" rows="5" align="left"> <?php echo "$text"; ?> </textarea> </td> </tr> <tr> <td bgcolor="#000" align="center" colspan="2"> <input class="button" type="submit" name="edit_thread" value="Start Thread" /> </td> </tr> </table> There is a class reference, but this has no effect on the problem when I remove it, so it must be something else... Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/#findComment-728457 Share on other sites More sharing options...
Brian W Posted January 2, 2009 Share Posted January 2, 2009 Please try the below <textarea class='mail' name="body" cols="50" rows="5" align="left"><?php echo "$text"; ?></textarea> Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/#findComment-728458 Share on other sites More sharing options...
Goose87 Posted January 2, 2009 Author Share Posted January 2, 2009 Please try the below <textarea class='mail' name="body" cols="50" rows="5" align="left"><?php echo "$text"; ?></textarea> oh! Thanks sooo much! It was such an obvious mistake, but I just needed someone to point it out! w00t! Proves that it doesn't always pay to make your code look neat, as it makes that fail Thanks again my friend Link to comment https://forums.phpfreaks.com/topic/139262-solved-php-output-into-textarea/#findComment-728460 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.