PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Redirect to modal window

  1. I've got a one line form (email capture) and the client wants it to submit the email then open a second form with all of the email signup options (multiple email lists) in a modal 'lightbox' form. They are using MailChimp so I'm using the addon for that.

    Is there a way to do this with Gravity Forms that I'm missing? If we're looking at custom code can you point me in the right direction please.

    I figured that I could use the ajax submit and capture the .click event but that also kills the submission of the first form so that doesn't seem to work. I couldn't figure out how to delay it or use .live to capture the confirmation text then present the modal form.

    Posted 13 years ago on Saturday September 25, 2010 | Permalink
  2. How comfortable are you with WordPress hooks and writing custom PHP? There is a hook on the submit button you can hook into to add a javascript action on it but you would need to write this code from scratch.

    Here is an example of using the gform_submit_botton hook. Please note this example doesn't do what you want it to do, it's just a code example. This example changes the default input type to use the button element with an included span, popular for implementing the Sliding Door CSS technique. Your implementation would be different.

    <?php
    // filter the Gravity Forms button type
    add_filter("gform_submit_button", "form_submit_button", 10, 2);
    function form_submit_button($button, $form){
    return "<button class='button' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
    }
    ?>
    Posted 13 years ago on Saturday September 25, 2010 | Permalink
  3. Is there a way to only rewrite the button for one form?

    Posted 13 years ago on Saturday September 25, 2010 | Permalink
  4. yes, another example for just a single form ID is here.

    http://forum.gravityhelp.com/topic/styling-the-submit-button-1#post-7367

    Posted 13 years ago on Sunday September 26, 2010 | Permalink