fileupload in Fabrik Window JS class

ricslabb03

Member
Hi,

I need to load a fabrik form in a fabrik window. I have a fileupload element inside this form. However, when I press save, the file is not uploaded. I have a few normal fields in the form as well, but they save fine. I would like to know if it is possible for a file to be uploaded in a fabrik window?

Here is the code (as suggested in http://fabrikar.com/forums/index.php?threads/open-form-with-javascript-popup-modal.48041/):

JavaScript:
Fabrik.getWindow({
   id: 'cds-add-document',
   contentURL: 'index.php?option=com_fabrik&view=form&formid=22&rowid=0&tmpl=component&ajax=1&format=partial',
   loadMethod: 'xhr',
   title: 'New Document',
   width: "200",
   height: "200"
});

Note the ajax parameter. If I take out ajax=1&format=partial the file saves as it is meant to, but it also reloads the parent window which I do not want.

Thank you in advance.
Richard
 
The only way to use an upload element in a popup (or any other form that submits via AJAX) is to enable AJAX uploading in the element, which then uses a "widget" to handle the upload, before the form is submitted.

This is a limitation of HTML, not a Fabrik problem. Although some browsers now support being able to do a standard upload through an AJAX form submission, some major browsers (like IE and Edge) still don't. So we don't support it.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top