Right, ok
Posted a while ago with another problem I had, here goes the next.
Right the forum I'm designing which I have done from scratch isn't having that many features so keeping it lightweight. I want to have a function where using javascript, when the user clicks 'edit' to edit there post, the text in the post disappears, replaced by a textbox with the original text in the text box ready to be edited, I'll then use the JS onBlur function to save it. I've got as far as making the text box appear, now in the textarea tags I use like the below:
This works, apart from where the lines break it shows break tags <br>. They don't show up when just displaying the text, only in the text box. Anyone have any ideas how to make this work, is it browser compatibility or..?Code:<textarea <?php echo $thetext; ?> </textarea>
Thanks in advance.
Already a topic on this mate... one that I need help with also!!
http://forum.codecall.net/php-forum/...es-br-php.html
Apparently there are two ways of doing it, there may be some replies in that threat that are of interest to you!
I think your problem is a little bit different, I'm not sure.
I need to both display the data staticly, and the same text displayable with the line breaks in the textarea
Sorry for the outside link, but I was wondering the same thing a couple weeks ago..
I found this script, Ajax flickr like edit: Flickr Like Edit Examples
I hope that works manand I sure hope that is what you were asking.. Lol, that is what I got out of it
![]()
Should work.Code:$thetext = str_replace('<br>', '\n', $thetext)
There is also another function which does the same as the above, though it's probably faster and it's also shorter to type. I'm sure someone will come along and show it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks