How to make "popup" when form saving?

Hi,
I have Joomla 2.5.11 and fabrik 3.0.8.

I am looking how to realise an issue that:
- jump "popup window" with question:"my text blablabla?" and 2 buttons: "Yes" or "No" after form saving
-
--when user answer "Yes" then redirect to "written by me somewhere in PA" some URL (url is a page from my fabrik site)
-- when user answer "No" then "popup window" is closed and do nothing.

So, i have no idea if i can use any form plugin for my issue?
 
The only way I can think of would be to embed your first form in a joomla article use {fabrik view=form....}

Create a second for with the yes/no buttons

From the first form, add a redirect plugin to go to the second form, and use the pop up options to open that in a window.

Then on the second form add a js event to the yes button to redirect to the final page, and a js event to close the window.
To close the window I think the js code would be:

Code:
$H(Fabrik.Windows).each(function (win) {
  win.close();
})
 
The only way I can think of would be to embed your first form in a joomla article use {fabrik view=form....}
It is a little more complicated - i use list1 --- then i have option "edit record" --- i need "jump popup" when "save" this "edited record".
So, i am not sure if i need to embed my list1 in a joomla article?

When i write this code in my article:
{fabrik view=list id=22} it works
but {fabrik view=form id=22} doesn't work

article ID: 99
list1 ID: 22
form1 ID: 22
---------------------------------------
When i use in my article:
{fabrik view=list id=22} and use redirect plugin for form id=22 with option popup than this "popup" doesn't work - i have content redirect in the "Same page"....
 
If you want edit records to appear in a pop up window turn on the list's ajax links option.
 
If you want edit records to appear in a pop up window turn on the list's ajax links option.
I need "question: go to some URL: YES/NO?" appear in a pop up window when save "edited record from list", it is different then you write...
 
sorry I really don't understand what it is you need to do in what order. Can you provide a diagram of this please?
 
I need "question: go to some URL: YES/NO?" appear in a pop up window when save "edited record from list", it is different then you write...


That's not really possible, or at least not easy. We can't do any redirection until the form is validated and submitted. You seem to be asking for a way of having the user choose where they redirect to, before the form is submitted.

This might be possible if you put your form in a J! article, so the submission happens via AJAX, and write some custom JS to run on the fabrik.form.submitted event, which gets fired after a successful AJAX submit in a content plugin.

But I'm assuming your JavaScript skills are minimal?

-- hugh
 
You seem to be asking for a way of having the user choose where they redirect to, before the form is submitted.

-- hugh

No, i ask for a way of having the user choose if he wants be redirected (YES option) or doesn't want (NO option) ---after--- the form is submitted.

The one important detail is that "this form" is not "new form" but is "edit form" (i use "edit form" from mylist1 with records)
 
If I got it right:
create an article with
{fabrik view=form id=22 rowid=[rowno]}

In your list add a custom edit link going to this article (instead directly to the form), e.g.
index.php?option=com_content&view=article&id=2&rowno={rowid}

than as in post#2
 
Ah, OK. So you just have one redirect, and you want a popup on submission, asking if they want to be redirected after submission.

OK, try this.

First, you'll need a hidden element, called something like "do_redirect". Make it an Integer, and set the default to -1.

You'll need to create a ./components/com_fabrik/js/form_X.js file, where X is your numeric form ID. In that, do this.

JavaScript:
Fabrik.addEvent('fabrik.form.submit.start', function (form, event, button) {
    var do_redirect_el = form.formElements.get('fab_ammend_test___do_redirect');
    if (form.options.rowid != '' && form.options.rowid != 0) {
        if (confirm("Do you want to redirect after submitting the form?")) {
            do_redirect_el.update('1');
        }
        else
        {
            do_redirect_el.update('0');
        }
    }
    return true;
})

Replace 'fab_ammend_test___do_redirect' with your full element name for the new hidden element, that code is for my test form.

Then on your redirect, in the Condition box, put this:

PHP:
return (int)'{fab_ammend_test___do_redirect_raw}' === 1;

Again, replace that element name with yours.

From the sound of it, you probably want to set you redirect to run "New" only, although you haven't explained that part of your requirent, i.e. how redirect should or shouldn't happen on new.

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

Thank you.

Members online

No members online now.
Back
Top