473,769 Members | 6,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<pre> / paste-glue / textarea

Hi,

I need to copy/paste texts form word, notepad... to an html textarea
to store it into a database.

With the <pre>tag, and a text with long lines, the text displayed in
the textarea needs to be scrolled horizontaly within the browser
window: I can't succeed in stopping the text to be larger than the
<table>;<tr>;<t d> settings.

If I use the <p> tag, I don't have any of the line break I had in my
original document and all the text is concateneted.

Thanks to those who can help me to find a solution.

Bi
Jul 23 '05 #1
5 5807
On 28/9/04 1:54 pm, spectre wrote:
Hi,

I need to copy/paste texts form word, notepad... to an html textarea
to store it into a database.

With the <pre>tag, and a text with long lines, the text displayed in
the textarea needs to be scrolled horizontaly within the browser
window: I can't succeed in stopping the text to be larger than the
<table>;<tr>;<t d> settings.


If you want horizontal scrolling in a text area, add wrap="off" to the
TEXTAREA tag.

--
Philip Ronan
ph***********@v irgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #2
spectre wrote:
If I use the <p> tag, I don't have any of the line break I had in my
original document and all the text is concateneted.


<p> with <br> in the appropriate places? I don't really understand your
problem.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #3
pr***********@y ahoo.fr (spectre) writes:
I need to copy/paste texts form word, notepad... to an html textarea
to store it into a database.
My sympathies. I have to do the same thing.
With the <pre>tag, and a text with long lines, the text displayed in
the textarea needs to be scrolled horizontaly within the browser
window: I can't succeed in stopping the text to be larger than the
<table>;<tr>;<t d> settings.


Use <tt> instead of <pre>, but escape newlines as <br>. I use
(brl-newline-escaper "<br>\n") in my application. PHP has nl2br().
You'll need to do something with server-side programming.

Note that if they paste tables, the columns won't line up. More
sophisticated text-to-html translation would be needed for that.

Also note that you'll get a lot of nonstandard Microsoft characters, for
quotes, etc. I use brl-msft-escape to fix it. You'll need to find
something in your server-side language that does the same thing.
There's a very complete Perl program called the demoronizer, if you're
using Perl.
Jul 23 '05 #4
"Bruce Lewis" <br*****@yahoo. com> a écrit dans le message de
news:nm******** *****@mint-square.mit.edu
I need to copy/paste texts form word, notepad... to an html textarea
to store it into a database.

(...) but escape newlines as <br>

(...)

If the idea is to save these texts in a database or anywhere else, for cms
purposes, I don't think this would be a good advice to have HTML in your
database records. You should keep datas media independant !

Jul 23 '05 #5
"Pierre Goiffon" <pg******@nowhe re.invalid> writes:
If the idea is to save these texts in a database or anywhere else, for cms
purposes, I don't think this would be a good advice to have HTML in your
database records. You should keep datas media independant !


No, the idea is not to save such text in a database. The escaping is
only for display. You are absolutely correct.

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8647
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample text</TD> <TD> not predefined font</TD></TR></TABLE>
7
18535
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px solid; color:red;
1
1802
by: Alan Illeman | last post by:
This is one of several macros I wish to display: <PRE CLASS="special macro> ;; ;; Reverse argument list ;; reverse_args MACRO arglist:req local txt, arg txt textequ <> % FOR arg, <arglist>
2
2789
by: Buck Turgidson | last post by:
I want to have a css with 2 PRE styles, one bold with large font, and another non-bold and smaller font. I am new to CSS (and not exactly an expert in HTML, for that matter). Is there a way to do this in CSS? <STYLE TYPE="text/css"> pre{ font-size:xx-large;
3
12925
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
7
2751
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
9
5548
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
14
3632
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good readibility on browsers w/o css-support. For important notes, warnings etc I use the <pre> tag, which shows in a neat bordered box when viewed with css, and depending on its class a clarifying background-image is shown. I would like the...
0
9589
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...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
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,...
1
7413
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
5310
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...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
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
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.