I Am Trying To Put A Scroll Box On My Myspace And What I Want To Put In The Scroll Box Is An Image HTML Code. But I Want The Scroll Box Only To Show The HTML Text Not The Image When It Is On My Profile. Does Any Body Know A Website Where The Scroll Boxes Do Not Show HTML Images Or How To Fix This?
Update:I'm Sorry To Say But None Of The Answers I Got So Far Helped Me. I Tried The One With The Pre And The Image Still Came Up. Then I Tired To Text Area And Pre One And It Didn't Even Show Up. Payne I Tried Yours But When People Copy And Paste The HTMLCode The Image Wouldn't Come Up. I Wanted The Image To Come Up After They Copied The Code. That's Why I Only Wanted The Text To Show So They Can Copy And Paste It.
Verified answer
Nobody has a clue how to do this!!!!
How to put HTML code in a textarea or scroll box:
You MUST deactivate the HTML code by making it appear as text in whichever box you use. The code I show below WILL work as it's been tested.
Change all the opening tag symbols, "<", to the character entity, & lt ; (without spaces). & lt ; (without spaces) = <. This will deactivate the HTML code in the textarea/scroll box, but allow users viewing the page to copy/paste the code.
Example:
<textarea style="background: transparent;" rows="8" cols="70"> & lt;img style="width: XXpx; width: YYpx; border: 0; src"pic link" alt="Text Description"> </textarea> There is no closing tag for the image tag unless you are using an XHTML DocType then the image tag is closed with a space an a "/": " /". Example:
& lt;img style="width: XXpx; width: YYpx; border: 0; src"pic
link" alt="Text Description" /&' gt;
&' lt; with out spaces = <
&' gt; without spaces = >
Ron
You probably mean a 'textarea'. And what you want to do is called 'escaping'. If you are using PHP, you can call <?php echo htmlspecialchars($data); ?> inside the textarea tags. If not, then you get to have fun with Javascript to do string replacements.
Why are you putting an image code if you don't want the image to show up? Put the text code only.
You will need to add the <pre> tags around the code that you do not want the browser to parse. For example:
<textarea>
<pre>
<img src="somepic.jpg" alt=""somepic">
</pre>
</textaread>
Stephen Williamson, Server Engineer, http://www.hostmysite.com/?utm_source=bb
The proper way to do this is to wrap the code you want to display with the following tags:
<pre>
Code here
</pre>
You could try <-- a href="whatever.gif" -->
the <-- --> tells the browser that what is in between <-- and --> is a comment.