(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