Jump to content

TEXTAREA


PrateekSaxena

Recommended Posts

Hi,I am not sure if this is even possible or not so I am gonna ask. Is it possible to have a TEXTAREA which has HTML code inside it and instead of displaying the HTML code the, the HTML code must be executed inside of it. Is this possible??Thanks,Prateek

Link to comment
Share on other sites

I am doing that at the moment

Link to comment
Share on other sites

here is a simple Rich Text Editor I had laying aroundrte.js

function rte(object){ if(typeof(object) == "string")  object = document.getElementById(object);  object.style.width = "640px"; object.style.height = "480px";  var iframe = document.createElement("iframe");   iframe.id = "rte_" + object.id; iframe.name = "rte_" + object.id; iframe.style.width = "100%"; iframe.style.height = "100%"; iframe.style.border = "1px solid #dedede"; iframe.frameBorder = "0"; object.appendChild(iframe);  //write document skeleton var content = "<html><head><title></title></head><body></body></html>"; if(document.getElementById(iframe.id).contentDocument)	//W3C standard {  document.getElementById(iframe.id).contentDocument.write(content);  document.getElementById(iframe.id).contentDocument.designMode = "on"; } else				//IE {  frames[iframe.id].document.write(content);  frames[iframe.id].document.designMode = "on"; }  return iframe;}

HTML

<html><head><title>RTE test</title><script src="rte.js"></script><script> onload = function() {  var rte1 = new rte("rte"); }</script></head><body><div id="rte"></div></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...