PrateekSaxena Posted May 12, 2007 Share Posted May 12, 2007 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 More sharing options...
cpugeek Posted May 12, 2007 Share Posted May 12, 2007 no it's not.but you could try a WYSIWYG.WYSIWYG: What You See Is What You Get.A good one that i found works is: openWYSIWYG. Link to comment Share on other sites More sharing options...
PrateekSaxena Posted May 13, 2007 Author Share Posted May 13, 2007 I am doing that at the moment Link to comment Share on other sites More sharing options...
aspnetguy Posted May 14, 2007 Share Posted May 14, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.