• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

(solved )Close popup window with JavaScript

jmoises

Active Member
Hello i manage to create a Button in my form and with Javascript show a Form as popup, what i like to be able to do is when the user click Save button close it.

Any help is apriciated thanks.
 
I manage to close the popup window with javascript but is not saving... i have try all the this events and no luck

  • fabrik.form.submit.start (form, event, button)
  • fabrik.form.submitted (form, json to update) - only called when form is saving using ajax
  • fabrik.form.submit.end (form)
  • fabrik.form.update (form, json)

Code:
requirejs(['fab/fabrik'], function () {
    Fabrik.addEvent('fabrik.form.submit.end', function(form) {
        window.close();
    })
});

any help is apriciated! thanks
 
After saving the form, the window should close after the message "Record Add/Updated."
How load popup form?
Write your js code.
 
Try with this code to load your form:
JavaScript:
jQuery('YOUR BUTTON').on('click', function(){
    Fabrik.getWindow({
        'id':'UNIQUER ID',
        'loadMethod': 'xhr',
        'contentURL':'index.php?option=com_fabrik&view=form&formid=XX&format=partial&tmpl=component&noredirect=1&ajax=1',
        'title': 'window title'});
})
 
Thanks,

hi because i use some elements to populate the url, i use the following core inside a javasctipt function so when i click the button my function start

Code:
Fabrik.getWindow({'id':'uniqueid','loadMethod': 'xhr','contentURL':url,'title': 'RegistroLlamada'});

The forms shows as popup window and looks great! but when i click save button i get this error:
upload_2019-12-10_10-18-21.png
the data is save it but the windows dosnt close
 
OK, i found that that i have the logs form pluging active and somehow make my form not able to close, when i disable the log form pluging my form works ok but i dont have any logs..

here is the error google crome shows. maybe is a BUG? right

Code:
<br />
<b>Notice</b>:  Array to string conversion in <b>/home/miapp/public_html/mysite.net/plugins/fabrik_form/logs/logs.php</b> on line <b>270</b><br />
<br />
<b>Notice</b>:  Array to string conversion in <b>/home/miapp/public_html/mysite.net/plugins/fabrik_form/logs/logs.php</b> on line <b>270</b><br />
<br />
<b>Notice</b>:  Array to string conversion in <b>/home/miapp/public_html/mysite.net/plugins/fabrik_form/logs/logs.php</b> on line <b>270</b><br />
{"msg":"","url":"http:\/\/mysite.net\/index.php?option=com_fabrik&view=form&Itemid=153&formid=1&rowid=9&listid=1","baseRedirect":true,"rowid":"1","suppressMsg":true}: SyntaxError: Unexpected token < in JSON at position 1
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top