Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Thanked 0 Times in 0 Posts

    Question how to use innerHTML for preview in Kevin Roth's rte


    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:
    <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
    <p><input type="submit" name="submit" value="Preview" /></p>

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



  2. #2
    New Coder
    Join Date
    Oct 2005
    Camino, California.
    Thanked 0 Times in 0 Posts
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts