473,472 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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>
Jul 16 '05 #1
4 5165
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
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
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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user...
9
by: Hal Halloway | last post by:
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this...
4
by: rukkie | last post by:
After a redisplay of the form, caused by errors in other fields, the text which is in the "Observ" textarea is shifted (some 8 places) to the right (and this each time after a redisplay). The code...
2
by: Cerebral Believer | last post by:
Hi folks, Can anyone help me with this form: http://futurebydesign-music.com/_member/club_fbd_reg.php I have followed to coding instructions aas closely as I can, but I am getting errors...
2
by: PTM | last post by:
I'm no javascript pro but have to write up a rather large system. Now I'm stuck with a problem. I would like to make a webpage where a customer vould edit short pieces of text, abt 200-300 chr....
6
by: Eric Layman | last post by:
Hi, I have fields from textareas. With a click of a button, php is able to grab these fields and by using header(), convert the output to Ms Word doc. But the outcome of the word doc...
1
by: nagamalli26 | last post by:
hai iam new php. i am creating admin side. i wrote this, phpcode: <?php //include_once("config.php"); $con=mysql_connect("localhost","root",""); mysql_select_db("happysalary"); ?>
1
by: cabbiepete | last post by:
In the thread http://www.thescripts.com/forum/thread11792.html this question was posed and while an answer was posted it wasn't explained at all why that worked. I thought I would post the answer in...
5
by: alf8kitty | last post by:
Hello, I have a form that allows a user to submit notes in a textarea. <td><textarea name="Notes" value="" ROWS=3 COLS=35></textarea></td> The notes get sent to the MySQL database correctly...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.