Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TEXTBOX Question

Posted on 1999-06-22
11
Medium Priority
?
229 Views
Last Modified: 2011-10-03
I want to show an html example in a textbox via a CGI, but I don't want the textbox to translate my html tags like " " etc
Any help to this stupid question?
Thanks
0
Comment
Question by:xabi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 7

Expert Comment

by:nettrom
ID: 1851036
does the text box translate   even if you do:

<textarea>
... HTML code goes here...
</textarea>

if it does, make the & an entity, like &amp;nbsp;  which would then show up correclty like &nbsp; in the text.
0
 
LVL 9

Expert Comment

by:TTom
ID: 1851037
You might also try using <code></code> tags around the code in your textbox.  I think that should tell the browser to leave it alone.

Tom
0
 
LVL 9

Expert Comment

by:TTom
ID: 1851038
Never mind.  Didn't work.

Tom (:-{
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
Bhargava earned 150 total points
ID: 1851039
I tried this and there was no problem.
 <textarea><table></textarea>

0
 
LVL 9

Expert Comment

by:TTom
ID: 1851040
Textarea does not seem to translate the <> tags, but it does seem to translate things like &nbsp;, so I would guess the first 'solution' is the valid one.

Tom
0
 
LVL 7

Expert Comment

by:nettrom
ID: 1851041
yep.  if it does translate &nbsp; to a regular space putting the HTML inn raw isn't going to work.  I'd instead convert everything to entities (< to &lt;, > to &gt;, & to &amp; and so forth) and hope everything worked from there.
0
 
LVL 9

Expert Comment

by:TTom
ID: 1851042
nettrom:

Seems to me that's what you suggested in the first place.  Sorry to see your suggestion was ignored in favor of one that doesn't work.  (If it had, I would have posted it as an answer when I first commented.)

Tom (:-{
0
 
LVL 7

Expert Comment

by:nettrom
ID: 1851043
you're right at that Tom.  even though there's probably little chance that I'll ever see any points on this (doesn't really matter either :) I did some testing with Netscape 3.04, 4.61 and IE5.  They all show code directly, but they translate entities.  Therefore:

<textarea><table></textarea> shows '<table>' inside the text area.

but if you use any entities, like &nbsp;, &quot;, &lt; or &gt; they all get translated for you so they show up as   (blank space), ", < and > in the textarea (happened on all browsers).  this in turn means that you'll _have_ to encode the ampersand in the entitities to make sure they're shown correctly.  in other words:

&nbsp; => &amp;nbsp;
&quot; => &amp;quot;
&lt; => &amp;lt;
&gt; => &amp;gt;

dunno if xabi will run over to customer support and try to move the points, or whatever. :)
0
 
LVL 8

Author Comment

by:xabi
ID: 1851044
Sorry TTOM and NETTROM you are right, so how can I can I give you the points? SOrry I'm new in Experts Exchange
0
 
LVL 9

Expert Comment

by:TTom
ID: 1851045
xabi:

Best you can do is to try Customer Service.  nettrom says it's not a big deal (for him); it's more about the principle than the practice.

What really counts is that you got the right answer!

Welcome to the exchange.  It's a great resource (IMNSHO) <G>

Tom
0
 
LVL 7

Expert Comment

by:nettrom
ID: 1851046
xabi:  it's not a big deal for me.  as Tom said, it's more of a principle so it's not necessary that you do a whole lot of work to get anything done here.  I can live without those points. :)

what counts in my opinion is that you in the end get the right answer, and that it's an answer you are satisfied with.

welcome to EE, I find it a good resource too, even though I haven't asked a question yet. :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question