By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

textarea box in form, but displays as line in echo

P: n/a
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>
Jul 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <en*****@pacbell.net> wrote in message
news:Fa****************@newssvr22.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>

Jul 16 '05 #2

P: n/a
Hi Entoone!

On Tue, 05 Aug 2003 22:38:36 GMT, "entoone" <en*****@pacbell.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 www.php.net.


"point" <po***@caanproduction.com> wrote in message
news:bg*********@enews2.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" <en*****@pacbell.net> wrote in message
news:Fa****************@newssvr22.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.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #3

P: n/a
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
Jul 16 '05 #4

P: n/a
<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" <ma*******@askmenoquestions.co.uk> wrote in message
news:yB*********************@wards.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

Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.