Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-08-2006, 05:33 PM   PM User | #1
mel03
New to the CF scene

 
Join Date: Sep 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mel03 is an unknown quantity at this point
Question how to use innerHTML for preview in Kevin Roth's rte

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 but I still can't fiigure out it works.

Can anyone help?

The form code is below:
Code:
<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
mel03 is offline   Reply With Quote
Old 12-08-2006, 06:00 PM   PM User | #2
cameronlanni
New Coder

 
Join Date: Oct 2005
Location: Camino, California.
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
cameronlanni is an unknown quantity at this point
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.
__________________
Currently designing and coding an entire RPG in VB
cameronlanni is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:11 AM.


Advertisement
Log in to turn off these ads.