Hi. I'm afraid I can't get Example 1 or 2 to work. I'm getting the following javascript error at line 176 of popup_forms_parent.js :

TypeError: dialog_options is undefined

Neither of the examples provide a value for the TypeError parameter for the popupFormsFormShow() function.

Please advise, is this a bug, or a documentation issue, or am I overlooking something?

Update: I've solved my issue. I misinterpreted

'Note: please use dev version, 7.x-1.x release was made by mistake.'

.. to mean use version 7.x-1.x-dev. I wonder if you could change it to 'Note: please use version 7.x-2.x-dev .. ' to avoid others making the same mistake?

Comments

roblog created an issue. See original summary.

roblog’s picture

Component: Code » Documentation
Issue summary: View changes
roblog’s picture

Issue summary: View changes
roblog’s picture

Issue summary: View changes
roblog’s picture

Issue summary: View changes
codeyourdream’s picture

Hello,

The examples are somewhat outdated. popupFormsFormShow() function takes 4 parameters, but 2 or 3 are passed in the examples. Please use "{}" (without quotes) for them.

Please DON'T use 7.x-2.x-dev version, it was too made by mistake and is now outdated (that's why the examples may work).

codeyourdream’s picture

That's how the call to popupFormsFormShow() in the first example should look like:

        popupFormsFormShow('example1_user_login', function(form_state) {
          alert(Drupal.t('Hello, @username!', {
            '@username': form_state.values.name
          }));
          window.location.reload();
        }, {}, {});

The second example:
popupFormsFormShow('example2_example_form', null, {arg: Math.random()}, {});

roblog’s picture

Hi Dmitry. I've reverted back to 7.x-1.x-dev and used {} for the 4th parameter like you advised, and it works :) Thanks very much for responding.