pwarkentin
Posts: 1
|
Posted: 01/06/2014, 8:43 AM |
|
I had the same issue and fixed using the following adjustment from this post
http://forums.codecharge.com/posts.php?post_id=105656
On the UPDATER form
- client side onsubmit event
- insert the following javascript code:
// Copy from here ...
var hiddeniframe, name;
name = this.getAttribute("name")+'_iframe';
hiddeniframe = document.createElement("iframe");
hiddeniframe.setAttribute("id", name);
hiddeniframe.setAttribute("name", name);
hiddeniframe.setAttribute("width","0");
hiddeniframe.setAttribute("height","0");
hiddeniframe.setAttribute("border","0");
hiddeniframe.setAttribute("style","width: 0; height: 0; border: none;");
this.parentNode.appendChild(hiddeniframe);
this.close();
window.frames[name].name = name;
this.setAttribute("target",name);
this.submit();
// ... to here
This fixes the insert process adding 2 records. I believe it's closing the current window (thus not allowing the initial submit to run) prior to submitting the hidden iframe which takes over processing.
However, I still had a prob with the and "file attachment in field FileUpload1 is required." error when deleting the file. Quick fix for me was:
- On the server event "After Delete File" on the FileUpload1 field.
- set the FileUpload1 field to null (or blank)
ie. Insert similar code (in my case PHP)
global $DBMySql;
$id=CCGetParam("id","-1");
$DBMySql->query("update invoice_donations set idon_file='' where idon_id=".$id);
More DB processing but it worked for me. Hope this helps someone else.
Good luck.
|
|
|
|