Monday, December 12, 2011

How would I show raw html inside of a text box?

I want to show the html for an image and place it inside of a text box so other people can use the code to place the image on their page. How would I do that?How would I show raw html inside of a text box?
Try this...



Use Entities, instead of %26lt;, ';, and %26gt;, because I don't think they will work, they will just show up HTML code. Entities can be found here. http://www.w3schools.com/html/html_entities.asp



%26lt;textarea rows=';5'; cols=';30';%26gt;

%26lt;img src=';yourimagesource.type';%26gt;

%26lt;/textarea%26gt;How would I show raw html inside of a text box?
Use the appropriate html entities (http://w3schools.com/tags/ref_entities.a so:



%26lt; becomes %26amp;lt;

%26gt; becomes %26amp;gt;



you'll write %26amp; lt; in the page's code, but it will display as %26lt; on the page.



So for a whole image tag you'd end up with something like



%26amp;lt;img src=%26amp;quot;path%26amp;quot;%26amp;gt;



which then displays as:

%26lt;img src=';path';%26gt;




%26lt;form%26gt;

%26lt;textarea cols=';48'; rows=';3';%26gt;

%26lt;img width=';100';src=';your codes inside the textarea tags but these cannot include textarea tags';height=';100';%26gt;

%26lt;/textarea%26gt;

%26lt;/form%26gt;



does this make sense?

also be sure to include height and width tags it makes loading faster Also arranging these elements in the order of: width, src, height will make it more quickly interpreted by Internet Explorer!




Place %26lt;textarea%26gt; tags around the code. You can further specify the height and width of the text box using col=';#'; and row=';#'; inside the %26lt;textarea%26gt; tag.



ie. %26lt;textarea col=';10'; row=';10';%26gt;[code]%26lt;/textarea%26gt;
put the code in notepad then uplaod to photobucket that notepad doc(name it htmlcode.jpg so photobucket thinks its a pic)thenyou know the rest
Here is the raw code:

%26lt;textarea%26gt;';insert picture html here';%26lt;/textarea%26gt;
you use %26lt;xmp%26gt;%26lt;/xmp%26gt; tags. but they are spacey. it removed hte next for a text box...



or here is the coed for a text box.



%26lt;input id='box name' type='text' style='width: (WIDTH NUMBER)px; height: (HEIGHT NUMBER)px;'value='madd text here.'%26gt;%26lt;br%26gt;

No comments:

Post a Comment