Multipled instance of CuteEditor ... how to validate via javascript a certain instance

Last post 08-27-2008, 8:39 AM by goldd1gger. 2 replies.
Sort Posts: Previous Next
  •  08-26-2008, 3:16 PM 43279

    Multipled instance of CuteEditor ... how to validate via javascript a certain instance

    I have 3 instances of cute editor.  I want to validate the third instance to ensure that data has been entered. 
    The third instance has the ID of Editor3.  How do I reference that ID in javascript. 
     
    My code:
     
    $editor=new CuteEditor();
    $editor->ID="Editor3";
    $editor->Text="";
    $editor->EditorBodyStyle="font:normal 12px arial;";
    $editor->EditorWysiwygModeCss="php.css";
    $editor->FilesPath="CuteEditor_Files";
    $editor->AutoConfigure="Minimal";
    $editor->Width="60%";
    $editor->Height="200";
    $editor->Draw();
    $editor=null;

    When there is only one, I am able to use 
    the following to validate:
     
    var editorbox = document.getElementById('CE_Editor1_ID');
    var content = editorbox.getHTML();
     
        if (content == "" || content == null) {
            strMsg = strMsg + 'something is missing.' + '"r"n';
            formvalidationOK = false;} 
  •  08-26-2008, 3:40 PM 43281 in reply to 43279

    Re: Multipled instance of CuteEditor ... how to validate via javascript a certain instance

    First instance, ID is Editor1.
     
    Get Editor object:
     
     var Editor1= document.getElementById('CE_Editor1_ID');
     
    Second instance, ID is Editor2.
     
    Get Editor object:
     
     var Editor2= document.getElementById('CE_Editor2_ID');
     
    Third instance, ID is Editor3.
     
    Get Editor object:
     
     var Editor3= document.getElementById('CE_Editor3_ID');
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-27-2008, 8:39 AM 43308 in reply to 43281

    Re: Multipled instance of CuteEditor ... how to validate via javascript a certain instance

    Thanks.  I managed to figure that out by playing with the code.  But thanks anyway for the quick response.
View as RSS news feed in XML