Re: Programmatically set font - Javascript

  •  04-07-2014, 3:45 AM

    Re: Programmatically set font - Javascript

    Hi erdnase,

     

    Please try the example  below, it shows you how to change the font name/size dropdown list in javascript when editor load.

     

    1. <%@ Page Language="c#" ValidateRequest="false" %>  
    2.   
    3. <%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>  
    4.   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    6. <html xmlns="http://www.w3.org/1999/xhtml">  
    7. <head>  
    8.   
    9. </head>  
    10. <body>  
    11.     <form id="Form1" method="post" runat="server">  
    12.         <RTE:Editor ID="Editor1" runat="server"  />  
    13.   
    14.     </form>  
    15. </body>  
    16. </html>  
    17. <script type="text/javascript">  
    18.   
    19.     function RichTextEditor_OnCoreLoad(editor) {  
    20.         var config = editor._config;  
    21.         //change the configuration settings  
    22.         config.fontnamelist = "Arial";  
    23.         config.fontsizelist = "8px";  
    24.     }  
    25. </script>  
     

    Regards,

     

    Ken 

View Complete Thread