Form Custom Button iFrame

sunnyjey

Active Member
I am trying to open PDF URL in iframe when Someone clicks on Custom Button in the Form next to the Submit button.

I have successfully created Custom Button (named 'Preview') with the help of THIS thread. Added following code ./component/com_fabrik/js/form_X.js (where X is numeric form ID).

Code:
requirejs(['fab/fabrik'], function() {
   Fabrik.addEvent('fabrik.form.submit', function (form, e, btn) {
       if (btn.name === 'Preview') {
           Fabrik.getWindow({id:'uniqueid', 'loadMethod': 'iframe', 'contentURL':'http://fabrikar.com', 'title': 'window title'});
       }
   });
});

When I put following code in Javascript option of Button Element, it works.

Code:
Fabrik.getWindow({id:'uniqueid', 'loadMethod': 'html', 'content':'hello'});

or

Code:
Fabrik.getWindow({id:'uniqueid', 'loadMethod': 'iframe', 'contentURL':'http://fabrikar.com', 'title': 'window title'});


I read many forum thread, but couldn't figured out. Any help will be greatly appreciated.
 
Last edited:
So what does not work?
Do you want to show a "preview" via Fabrik PDF of the form just filled out but not yet submitted?

This won't do. The Fabrik PDF (...&format=PDF...etc) will pull the details view, showing the stored data, not the new not yet submitted data of the form.
 
Thank you for reply.

So what does not work?

iframe doesn't work. I dont see any popup Modal iframe window opening when I click on Custom Button next to Submit button, like what I see when I click on Button Element. No JS errors in console.

Yes. I know, PDF pulls stored data. I just gave this as an example.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top