...

View Full Version : how to use innerHTML for preview in Kevin Roth's rte



mel03
12-08-2006, 05:33 PM
Hi,

I am trying to install Kevin Roth's Cross-Browser Rich Text Editor on my website.
I would like to show preview of the content when the submit button is clicked using the javascript innerHTML function.
Kevin has a usage example here (http://www.kevinroth.com/rte/usage.htm)but I still can't fiigure out it works.

Can anyone help?

The form code is below:


<form name="RTEDemo" action="demo.htm" method="post" onsubmit="return submitForm();">

<!--
function submitForm() {
//make sure hidden and iframe values are in sync for all rtes before submitting form --- this is the part that I don't understand
updateRTEs(); //how should I write the funtion here for preview using innerHTML

}

//Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML, encHTML)

initRTE("./images/", "./", "", false);

//build new richTextEditor
var rte1 = new richTextEditor('rte1');
rte1.html = 'here's the "\<em\>preloaded\<\/em\>&nbsp;\<b\>content\<\/b\>"';
//below would be the script to build the rte
//

rte1.build();
//-->
</script>

<p><input type="submit" name="submit" value="Preview" /></p>
</form>



where should I add the iframe and hidden values for the form?

Thanks.

Melissa

cameronlanni
12-08-2006, 06:00 PM
Well, the first thing that jumps out at me is that the first line of code you have here is HTML and the rest is JavaScript. For the beggining use the HTML Tags (<HTML></HTML>) and for the JScript, use the JScript Tags (<Script Language=JavaScript></Script>)

Otherwise the browser can't distiguish the difference in languages.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum