473,804 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ 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">Additi onal Comments/Counties Covered</font></td>

<td width="100%"> <input type="textarea" size="80" name="ud_commen ts"
value="<? echo "$comments"?>"> </td>
</tr>
Jul 16 '05 #1
4 5188
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*****@pacbel l.net> wrote in message
news:Fa******** ********@newssv r22.news.prodig y.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">Additi onal Comments/Counties Covered</font></td>
<td width="100%"> <input type="textarea" size="80" name="ud_commen ts" value="<? echo "$comments"?>"> </td>
</tr>

Jul 16 '05 #2
Hi Entoone!

On Tue, 05 Aug 2003 22:38:36 GMT, "entoone" <en*****@pacbel l.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***@caanprod uction.com> wrote in message
news:bg******* **@enews2.newsg uy.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*****@pacbel l.net> wrote in message
news:Fa******** ********@newssv r22.news.prodig y.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">Additi onal Comments/Counties

Covered</font></td>
>
> <td width="100%"> <input type="textarea" size="80"

name="ud_commen ts"
> 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_commen ts" 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*******@askm enoquestions.co .uk> wrote in message
news:yB******** *************@w ards.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
7986
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 could hit a 'return to entry form' button or some-such and go back to the form. But what I want to do instead is just use an HTML link with some javascript to grab the form's textarea value, and open another browser window that uses a php file...
9
9365
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 is done in PHPMyadmin for example...is there an easy way to do this? In a way i'm asking the browser to suspend rendering markup.
4
2266
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 used in case of redisplay is : <tr> <td align="right"> Observations : </td> <td>
2
1949
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 about not filling in all the fields on the form correctly when I test it. Is validating a form with radio buttons difficult?
2
1743
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. If only this text were allways from and to the same file, there would be no problem. I have made many pages with forms. But now we need to make it so that the name of the file comes as query_string from a PERL script and the file should go to...
6
4646
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 doesn't wrap the text in textarea. the result is one very veyr long string of text which stretch MS word all
1
2025
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
7938
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 detail to help anyone else that searches for this. Read the original question and answer to get the context but I will cut to the reason. The Reason the answer works and the other one doesn't The \n is double quoted in the code that works. So 2...
5
2304
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 when I check out the database entries. I have another form on the same page that pulls the notes field (along with some others) to display in another textarea. However, although the other fields pulled are displayed, the notes textarea remains...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
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 we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.