Closed Thread
Results 1 to 8 of 8

Thread: PHP, JS and HTML. Displaying form.

  1. #1
    jaydee is offline Newbie
    Join Date
    Sep 2009
    Posts
    17
    Rep Power
    0

    PHP, JS and HTML. Displaying form.

    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:
    Code:
    <textarea <?php echo $thetext?> </textarea>
    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..?

    Thanks in advance.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Bioshox is offline Programmer
    Join Date
    Oct 2009
    Location
    Manchester, UK
    Posts
    196
    Rep Power
    10

    Re: PHP, JS and HTML. Displaying form.

    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 !

  4. #3
    jaydee is offline Newbie
    Join Date
    Sep 2009
    Posts
    17
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    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

  5. #4
    Furry Pancake's Avatar
    Furry Pancake is offline Learning Programmer
    Join Date
    Feb 2010
    Location
    Utah
    Posts
    54
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    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 man and I sure hope that is what you were asking.. Lol, that is what I got out of it

  6. #5
    TriggerHappy is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    30
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    Code:
    $thetext str_replace('<br>''\n'$thetext
    Should work.

  7. #6
    Furry Pancake's Avatar
    Furry Pancake is offline Learning Programmer
    Join Date
    Feb 2010
    Location
    Utah
    Posts
    54
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    Quote Originally Posted by TriggerHappy View Post
    Code:
    $thetext str_replace('<br>''\n'$thetext
    Should work.
    You put me to shame. Thank you

  8. #7
    TriggerHappy is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    30
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    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.

  9. #8
    jaydee is offline Newbie
    Join Date
    Sep 2009
    Posts
    17
    Rep Power
    0

    Re: PHP, JS and HTML. Displaying form.

    Quote Originally Posted by TriggerHappy View Post
    Code:
    $thetext str_replace('<br>''\n'$thetext
    Should work.
    Worked perfect, thanks

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Displaying MySQL data in HTML with PHP
    By dunnkers in forum PHP Development
    Replies: 4
    Last Post: 07-16-2010, 08:53 AM
  2. Displaying echo messages in HTML
    By Alex_j in forum PHP Development
    Replies: 1
    Last Post: 03-11-2010, 08:11 PM
  3. HTML Form Help
    By Chewie in forum HTML Programming
    Replies: 11
    Last Post: 08-13-2009, 03:58 PM
  4. search displaying in another form.
    By OliWilding in forum Visual Basic Programming
    Replies: 0
    Last Post: 02-06-2009, 10:38 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts