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).
When I put following code in Javascript option of Button Element, it works.
or
I read many forum thread, but couldn't figured out. Any help will be greatly appreciated.
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: