Unable to delete file attachments in EditForm.aspx in FireFox RRS feed

  • Question

  • Steps to reproduce:

    1. Open a list item for editing in FireFox.
    2. Click 'Attach File' button.
    3. Click 'Browse...', select some file, click 'Open', click 'OK'.
    4. Click small 'Delete' button near to your just attached filename - it does not work!
    5. To compare, perform steps 1-4 in IE - it works.

    Question: can anybody else confirm that? Any workaround?

    • Edited by Mike Walsh FIN Thursday, February 11, 2010 5:52 PM Bug?: removed from Title
    Thursday, February 11, 2010 4:26 PM


  • It looks like the problem is in forms.js in OkAttach() function. There is a line:

    oCellControl.innerHTML="<IMG SRC='"+document.getElementsByName("RectGifUrl").item(0).value+"'>&nbsp;<a href='javascript:RemoveLocal("+RowID+",\""+fileID+"\")'>"+L_Delete_Text+"</a>";

    First parametr of RemoveLocal() function is specified in a wrong way (so it does not work in FireFox but works in IE). The correct version of this line could be like that:

    oCellControl.innerHTML="<IMG SRC='"+document.getElementsByName("RectGifUrl").item(0).value+"'>&nbsp;<a href='javascript:RemoveLocal(document.getElementById(\""+RowID+"\"),\""+fileID+"\")'>"+L_Delete_Text+"</a>";

    So, if you want to fix a problem globally you may want to replace that line in ...\12\TEMPLATE\LAYOUTS\1033\FORM.JS (but keep in mind that upcoming service packs may overwrite that file again). If you want to fix this problem locally for just some custom page you may copy the entire text of OkAttach() function into your custom page and then replace the wrong line there.

    Hope this helps.

    • Marked as answer by Sergioko Thursday, February 11, 2010 9:58 PM
    Thursday, February 11, 2010 9:54 PM