Trying to execute a bit of javascript to delete the files in an Upload field, and then save the empty field as updated to the Forms db when the form is submitted.
Assume we have a field "Upload1" with selector #q1, and it has a file(s) saved into it from a previous step in the process. Upon loading the form for a later step, if we execute a remove on the files table with "$('#q1 table.files>tbody>tr').remove();", it appears to work in so much as the files are no longer shown in that field. But, when the form is submitted, the files remain part of the instance in the database - the empty upload field does not overwrite the previous files.
If we take a different approach and act on the file delete button (the "X" at the end of the row) with "$('#q1 .file-del').trigger('click');" that does work, but it kicks off the confirmation modal which requires the user to click "Delete" in the confirmation box. This is not acceptable, as we want the field to clear with javascript and no user action, and I don't know of a way to bypass the modal.
Any ideas?