473,288 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

how to display whatever the user types in a textarea

We have an input field which allows the user to enter a string of (up
to 62) ASCII printable characters. We have a need to allow the user to
be able to specify any sequence of characters he/she desires.

However, we have a problem when we attempt to display this same string
of characters. If the input sequence of characters contains HTML
interpretable strings of characters, the user's sequence of characters
is not properly displayed. (We are using <td>string</td> to display the
string.)

For example:
If the user enters "ID-12<DALLAS>\STV"
the string is displayed as "ID-12\STV"

The problem is that the text "<DALLAS>" is being interpreted as an HTML
tag. We can circumvent this problem by pre-parsing the display string
and replacing the "<" with "&lt;", resulting in the proper display of
the string.

However, there is a very long list of standard HTML characters whose
mnemonic and/or numeric representations are translated by HTML for
display purposes.

For example:
If the user enters "ID-12&iexcl;" or "ID-12¡"
the user expects the string to be displayed as "ID-12&iexcl;" or
"ID-12¡", not "ID-12!" (where the "!" actually represents an
inverted exclamation point).

We have tried to display the user's string with <PRE>string</PRE>,
<CODE>string</CODE>, <BLOCKQUOTE>string</BLOCKQUOTE> and even the
deprecated <LISTING>string</LISTING> to no avail. Even though our
reference text implies that the sequence of characters between <PRE>
and </PRE> will not be interpreted by HTML, both of our browsers (MS
and Netscape) do interpret the characters.

Is there any way to display a sequence of characters without the
browser interpreting the sequence of characters?
Thanks,
Siva

Nov 23 '05 #1
2 1953
<s.********@gmail.com> wrote:
Is there any way to display a sequence of characters without the
browser interpreting the sequence of characters?


See http://www.htmlhelp.com/faq/html/basics.html#show-html

Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"The early bird gets the worm, but the second mouse gets the cheese."
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"The early bird gets the worm, but the second mouse gets the cheese."
Nov 23 '05 #2
s.********@gmail.com wrote:
The problem is that the text "<DALLAS>" is being interpreted as an HTML
tag. We can circumvent this problem by pre-parsing the display string
and replacing the "<" with "&lt;", resulting in the proper display of
the string.

However, there is a very long list of standard HTML characters whose
mnemonic and/or numeric representations are translated by HTML for
display purposes.
one, two, many ;)
There are in fact only three characters that must be encoded: '<', '>' and
'&'. A pretty long list, I must admit...
For example:
If the user enters "ID-12&iexcl;" or "ID-12¡"
the user expects the string to be displayed as "ID-12&iexcl;" or
"ID-12¡", not "ID-12!" (where the "!" actually represents an
inverted exclamation point).
It is sufficient to quote the '&' here:

User enters: "ID-12&iexcl;"
Inserted into HTML: "ID-12&amp;iexcl;"
Displayed: "ID-12&iexcl;"
We have tried to display the user's string with <PRE>string</PRE>,
<CODE>string</CODE>, <BLOCKQUOTE>string</BLOCKQUOTE> and even the
deprecated <LISTING>string</LISTING> to no avail. Even though our
reference text
Time to look for a correct reference text.
implies that the sequence of characters between <PRE>
and </PRE> will not be interpreted by HTML, both of our browsers (MS
and Netscape) do interpret the characters.


--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Nov 23 '05 #3

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

Similar topics

4
by: hoke | last post by:
I want to display plain text files in the browser. The files contain html and javascript and have a .txt extension. This works fine with files with just html. Unfortunately when showing files with...
4
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
14
by: JStrauss | last post by:
Hello, Can anybody give me some tips on the best and/or easiest way to display multiple lines in a field. The data is collected from a "textarea" field when the form is submitted, and I want to...
5
by: Richard | last post by:
I am filling a TEXTAREA with text and links from a database. I need to display the <a href....> code in the TEXTAREA as a clickable link with _blank targetting. I realise I could simply use a TD...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
2
by: groups | last post by:
Hello, HTML-heads. Odd problem that I haven't encountered before. This form and/or textarea is appearing to have no columns or no width to the end user. This only happens to the user on one...
6
by: tony wong | last post by:
i wish to count number of characters in textarea box during typing in and display it somewhere in html page. so the number will increase during writing. is it possible to do it by javascript? ...
3
by: Erwin Moller | last post by:
Hi all, Situation: A (rather long) page that contains a lot of divs. Some are visible (display:inline) at a certain time, other not. The javascript is responsible for divs to be visible or...
3
by: jiayanxiang | last post by:
Is there any sample code to use Javascript to load and display a text file? It will be best if the user can select files using some kind of explorer. If that's complex, a text box to specify the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.