3 Replies Latest reply on Jan 26, 2010 1:11 PM by Nenad Nikolic

    Richface Editor, how to set text with javascript?

    Nenad Nikolic Newbie

      Hi,

       

      I want to set text in rich:editor manualy, with javascript function. Can anybody tell me how to do this?


      I need something like this:

      <script type="text/javascript">
          function insertText(id){
              var editor = document.getElementById(id);
              editor.value = "some text";
          }
      </script>

       

      <a4j:form id="form">
           <rich:editor id="editor" theme="advanced"
                       height="350" width="700">
                  <f:param name="theme_advanced_buttons1" value="" />
                  <f:param name="theme_advanced_toolbar_location" value="" />

           </rich:editor>
           <a4j:commandButton value="Insert text" onclick="insertText('form:editor');" ></a4j:commandButton>

      </a4j:form>

       

      Thanks for replay.