Re: Can't attach event

  •  09-29-2006, 9:22 AM

    Re: Can't attach event

    Hi Adam,
     
    My source code in an ASP page is:
    editor.ID = editorName
    editor.Text = MessageField
    editor.FilesPath = "../CuteEditor_Files"
    editor.CustomCulture = editor_Culture
    editor.AllowUpload = editor_AllowUpload
    editor.ImageGalleryPath = editor_ImageGalleryPath
    editor.FlashGalleryPath = editor_FlashGalleryPath
    editor.MediaGalleryPath = editor_MediaGalleryPath
    editor.FilesGalleryPath = editor_FilesGalleryPath
    editor.MaxImageSize = editor_MaxImageSize
    editor.MaxDocumentSize = editor_MaxImageSize
    editor.MaxFlashSize = editor_MaxFlashSize
    editor.Width = editor_Width
    editor.Height = editor_Height
    editor.RemoveServerNamesFromUrl = true
    editor.UseRelativeLinks = false
    editor.UsePhysicalFormattingTags = true
    editor.EnableAntiSpamEmailEncoder = true
    editor.EditorBodyStyle = "font:normal 12px arial;"
    editor.ConfigurationPath = "../CuteEditor_Files/Configuration/AutoConfigure/Full_noform.config"
    editor.EditorWysiwygModeCss = "../CuteEditor_Files/example.css"
    editor.EditorWysiwygModeCss = ""
    editor.BreakElement = "Br"
    editor.ThemeType = "Office2003"
    ' Editor.TextAreaStyle = "background-image:{url:\images\asp.jpg};"
    editor.Draw()
    After this, I read from the documentation that the javascript variable should be available as 'obj_' + editorName
     
    So, then I would like to attach to onkeypress:
    Response.Write("<script language=""javascript"" type=""text/javascript"">" & vbCrLf)
    Response.Write("var editDoc = obj_" & editorName & ".GetDocument()" & vbCrLf)
    Response.Write("editDoc.attachEvent('onkeypress', Changed, true);" & vbCrLf)
    Response.Write("</script>" & vbCrLf)
    I get an error at the GetDocument() method. As I've stated in my previous post, alternative methods also don't do the trick.
     
    Vincent
View Complete Thread