Professional Web Applications Themes

textarea box in form, but displays as line in echo - PHP Development

I have a form that has a text box, i.e. text area that takes 200 characters max. When I use my update script and it brings up the information in the database, it displays as a single line. How can I keep the same format of a box, instead of single line when viewing the database data for updating? This is how I'm calling the information into the box <tr> <td width="100%"> <font face="Arial" size="2">Additional Comments/Counties Covered</font></td> <td width="100%"> <input type="textarea" size="80" name="ud_comments" value="<? echo "$comments"?>"></td> </tr>...

  1. #1

    Default textarea box in form, but displays as line in echo

    I have a form that has a text box, i.e. text area that takes 200 characters
    max. When I use my update script and it brings up the information in the
    database, it displays as a single line. How can I keep the same format
    of a box, instead of single line when viewing the database data for
    updating?

    This is how I'm calling the information into the box

    <tr>

    <td width="100%">

    <font face="Arial" size="2">Additional Comments/Counties Covered</font></td>

    <td width="100%"> <input type="textarea" size="80" name="ud_comments"
    value="<? echo "$comments"?>"></td>


    </tr>


    entoone Guest

  2. #2

    Default Re: textarea box in form, but displays as line in echo

    before entering data to database use nl2br() and before displaying from
    database strip_slashes()...

    <input type="textarea"

    should be <textarea></textarea>..at least I use it like that....

    hope this helps....

    point


    "entoone" <entoonepacbell.net> wrote in message
    news:FaQXa.1496$BR4.738newssvr22.news.prodigy.com ...
    > I have a form that has a text box, i.e. text area that takes 200
    characters
    > max. When I use my update script and it brings up the information in the
    > database, it displays as a single line. How can I keep the same format
    > of a box, instead of single line when viewing the database data for
    > updating?
    >
    > This is how I'm calling the information into the box
    >
    > <tr>
    >
    > <td width="100%">
    >
    > <font face="Arial" size="2">Additional Comments/Counties
    Covered</font></td>
    >
    > <td width="100%"> <input type="textarea" size="80"
    name="ud_comments"
    > value="<? echo "$comments"?>"></td>
    >
    >
    > </tr>
    >
    >

    point Guest

  3. #3

    Default Re: textarea box in form, but displays as line in echo

    Hi Entoone!

    On Tue, 05 Aug 2003 22:38:36 GMT, "entoone" <entoonepacbell.net>
    wrote:
    >I'm not quite following you on this one...
    >
    <input type="textarea"> is not valid html.
    <textarea> </textarea> is.

    Also, in contrary to point, 'd like to suggest to not use nl2br()
    before entering into the database, but on display. You may want to use
    addslashes() for a different problem, when inserting updating into the
    database. You may want to use stripslashes() on display, depending on
    the setting of magic_quotes.

    HTH, Jochen

    P.S.: Look up the functions and buzzwords on [url]www.php.net[/url].

    >
    >"point" <pointcaanproduction.com> wrote in message
    >news:bgoki801cmjenews2.newsguy.com...
    >> before entering data to database use nl2br() and before displaying from
    >> database strip_slashes()...
    >>
    >> <input type="textarea"
    >>
    >> should be <textarea></textarea>..at least I use it like that....
    >>
    >> hope this helps....
    >>
    >> point
    >>
    >>
    >> "entoone" <entoonepacbell.net> wrote in message
    >> news:FaQXa.1496$BR4.738newssvr22.news.prodigy.com ...
    >> > I have a form that has a text box, i.e. text area that takes 200
    >> characters
    >> > max. When I use my update script and it brings up the information in the
    >> > database, it displays as a single line. How can I keep the same format
    >> > of a box, instead of single line when viewing the database data for
    >> > updating?
    >> >
    >> > This is how I'm calling the information into the box
    >> >
    >> > <tr>
    >> >
    >> > <td width="100%">
    >> >
    >> > <font face="Arial" size="2">Additional Comments/Counties
    >> Covered</font></td>
    >> >
    >> > <td width="100%"> <input type="textarea" size="80"
    >> name="ud_comments"
    >> > value="<? echo "$comments"?>"></td>
    >> >
    >> >
    >> > </tr>
    >> >
    >> >
    >>
    >>
    >
    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

  4. #4

    Default Re: textarea box in form, but displays as line in echo

    <td width="100%"> <textarea rows="4" name="ud_comments" cols="60"><?
    echo "$comments"?></textarea></td>


    I'm able to call the information from the db and have it displayed into a
    textarea box. The only thing is when I save it back to the database, via an
    update button. The line doesn't wrap.. it just makes the page format go
    bonkers! --- what do I need to do to keep it formatted without messing up
    the entire page that display it
    after it's been saved.



    "matty" <matt+nntpaskmenoquestions.co.uk> wrote in message
    news:yBXXa.52946$9C6.3144915wards.force9.net...
    > Jochen Daum wrote:
    >
    > >
    > > Also, in contrary to point, 'd like to suggest to not use nl2br()
    > > before entering into the database, but on display. You may want to use
    > > addslashes() for a different problem, when inserting updating into the
    > > database. You may want to use stripslashes() on display, depending on
    > > the setting of magic_quotes.
    >
    > Personally, I use neither! If it's a text-in-chunks type thing, I convert
    > linebreaks into paras (and vice versa) going between input and database,
    so
    > that when you're displaying it, you can use the field straight from the
    > database, with all the work done just the once, at the admin end
    >
    >

    entoone Guest

  5. #5

    Default Re: textarea box in form, but displays as line in echo

    Jochen Daum wrote:
    >
    > Also, in contrary to point, 'd like to suggest to not use nl2br()
    > before entering into the database, but on display. You may want to use
    > addslashes() for a different problem, when inserting updating into the
    > database. You may want to use stripslashes() on display, depending on
    > the setting of magic_quotes.
    Personally, I use neither! If it's a text-in-chunks type thing, I convert
    linebreaks into paras (and vice versa) going between input and database, so
    that when you're displaying it, you can use the field straight from the
    database, with all the work done just the once, at the admin end


    matty Guest

Similar Threads

  1. TextArea edition line
    By Peter Hahmann in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 19th, 03:09 PM
  2. DataGrid cell displays only the 1st line of Multilinetext !!!
    By flexbay in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: March 10th, 06:19 PM
  3. this echo line shows nothing anyone got any ideas?
    By Wayne... in forum PHP Development
    Replies: 3
    Last Post: June 21st, 09:25 PM
  4. TextArea line count
    By Heresy2k4 in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 27th, 08:09 PM
  5. Replies: 1
    Last Post: August 1st, 03:23 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139