Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

Last post 01-08-2010, 12:54 AM by Kenneth. 4 replies.
Sort Posts: Previous Next
  •  01-06-2010, 2:05 AM 58062

    Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

    Here is the sample page:
     
    Please advice.
    We are using 6.5.0.0 version and on Windows 2008
  •  01-06-2010, 4:00 AM 58064 in reply to 58062

    Re: Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

    Hi tcshekar,
     
    Can you send the code of that page to me?
     
     
    Regards,
     
    Ken
  •  01-07-2010, 10:50 PM 58090 in reply to 58064

    Re: Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

    Calling the dialog box on image click....see two lines below....and followed by the javascript function on the same .aspx page. Nothing happens, when you click on the browse button...no dialog box comes up.

    Editor1.Setting("security:FilesGalleryPath") = struploadinfo(0) 'sets the path
    Editor1.Setting("security:MaxDocumentFolderSize") = struploadinfo(1) 'sets the Folder limit
    Editor1.Setting("security:MaxDocumentSize") = struploadinfo(2) 'sets the file limit

    <asp:TextBox id="docFile" ReadOnly ="true" CssClass="longfield-select" runat="server" />

    <img alt="" title ="Browse" style="cursor: pointer" align="absmiddle" src="../buttons/browse.gif" onclick="callInsertImage()" runat ="server" id="Change" NAME="Change" />

     
    <script type ="text/javascript" language ="javascript" >

    function callInsertImage()

    {

    var editor1 = document.getElementById('<%=Editor1.ClientID%>');

    editor1.FocusDocument();

    var editdoc = editor1.GetDocument();

    editor1.ExecCommand('new');

    editor1.ExecCommand('insertdocument');

    InputURL();

    window.document.getElementById("docFile").focus();

    }

    function InputURL()

    {

    var editor1 = window.document.getElementById('<%=Editor1.ClientID%>');

    var editdoc = editor1.GetDocument();

    var links = editdoc.getElementsByTagName("a");

     

    if(links.length>0&&links[links.length-1].href!="")

    {

    window.document.getElementById("docFile").value = links[links.length-1].href;

    var docurl = links[links.length-1].href;

    var strImageGallery = docurl.lastIndexOf("/");

    var urllength = docurl.length;

    var newurl = docurl.substring(strImageGallery+1, urllength);

    window.document.getElementById("docFile").value=newurl

    window.document.getElementById("HiddenField1").value=window.document.getElementById("docFile").value

    }

    else

    {

    setTimeout(InputURL,500);

    }

    }

  •  01-07-2010, 10:52 PM 58091 in reply to 58064

    Re: Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

    Here is some missing code from the same page.

    <div style="visibility: hidden">

    <CE:Editor id="Editor1" width="1" height="1" runat="server" AutoConfigure="None"

    ShowHtmlMode="False" ShowPreviewMode="False" EnableContextMenu="false"

    ShowGroupMenuImage="False" ShowBottomBar="False" BackColor="#dedede"

    BorderColors="#dedede"></CE:Editor>

    <asp:HiddenField ID="HiddenField1" runat="server" />

    </div>

  •  01-08-2010, 12:54 AM 58094 in reply to 58091

    Re: Document Selector Example Throws In Javascript - Does not open the Dialog? Please help

    Hi tcshekar,
     
    Just need to remove <div style="visibility: hidden"></div>
     
    editor in this Element, if you hide it, the dialog will be hidden too.
     
    Regards,
     
    Ken
View as RSS news feed in XML