Supress InsertImage dialogbox

  •  03-22-2007, 4:24 PM

    Supress InsertImage dialogbox

    Hi,
     
    I want to supress the InsertImage dialog and only allow it when a condition is met.
    How can I do this?
    I try to return false but this doesn't help.
     
    Thank you in advance.
     
    This is my code:
    C#
    Editor1.Attributes["oncommand"]= "HandleEditorCommand(this);";
     
    then the 'JavaScriptCode':
    function HandleEditorCommand(editor)
    {
       if(event.command == "InsertImage")
       {
          var theDropDown = document.getElementById('ddlClient');
     
          if(theDropDown != null)
           {
             if(theDropDown.selectedIndex < 1)
            {
                alert(
    'Please select a client first.');
                //Supress the dialog box??
                return false;
             }
          }
       }
    }
View Complete Thread