Results 1 to 2 of 2

Thread: Javascript RT Editor

  1. #1
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Javascript RT Editor

    hi i am using a rich text editor for my site

    i got rt editor from

    http://www.dynamicdrive.com/dynamici...itor/index.htm

    this site

    But there is a problem in this for all browsers, when i am selecting a font from the font section.The font section is not showing which fond i choosed.it showing font only.( ie if i am selecting a Times new Roman i want to show up that fond name in that column,but here its just showing font)The same thing happening for all other controls in the rt editor.Can anyone suggest me a good editor or what is the problem i am facing in the current rt editor.i am not good in javascript.please give me a suggestion and an idea regarding with this.

    Have a nice day
    Thanks
    WOOD

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I've modified the source code in richtext.js which comes as a part of the RT Editor bundle. So if you've included richtext_compressed.js in your web pages then you have to remove that inclusion and have to include richtext.js

    Please replace your richtext.js with the attached richtext.js (I've modified this file).

    Modification Made
    -------------------
    This was very simple

    1. I've made the modification in the following function which is present in richtext.js

    Code:
    function selectFont(rte, selectname) {
    	//function to handle font changes
    	var idx = document.getElementById(selectname).selectedIndex;
    	// First one is always a label
    	if (idx != 0) {
    		var selected = document.getElementById(selectname).options[idx].value;
    		var cmd = selectname.replace('_' + rte, '');
    		rteCommand(rte, cmd, selected);
    		//document.getElementById(selectname).selectedIndex = 0;
    		document.getElementById(selectname).selectedIndex = idx;
    	}
    }
    Precisely I've changed the following line in the above function

    Code:
    document.getElementById(selectname).selectedIndex = 0;
    to the following line

    Code:
    document.getElementById(selectname).selectedIndex = idx;
    and achieved the result you want.

Bookmarks

Posting Permissions

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