remove link

  •  09-23-2009, 11:43 PM

    remove link

    hi
     
    how can i remove the link automatically when i input an url/email (remove the link once url/email is input into the cuteeditor panel)
     
    here is the function which kenneth provide me :
     

    <script type="text/javascript">   

    function CuteEditor_FilterHTML(editor,code)   

    {   

     return code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");   

    }   

    function CuteEditor_FilterCode(editor,code)   

    {   

     return code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");   

    }   

    </script> 

     
    i try to make some modification to the function
     

    function CuteEditor_FilterHTML(editor,code)

    {

    var sHTML;

    sHTML=code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");

    editor.setHTML(sHTML);

    }

    function CuteEditor_FilterCode(editor,code)

    {

    var sHTML;

    sHTML=code.replace(/(<a[^\>]*\>)([\s\S]*)(\<\/a\>)/i, "$2");

    editor.setHTML(sHTML);

    }
     
    but everytime i add/select a layer, it will lost focus to that layer.....it unable me to change the text inside the layer (maybe is cause by i reset the HTML)
     
    thanks
View Complete Thread