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.

MaxButtons supprt

  1. jeroenlh
    Member

    Is the any way to use MaxButtons (from maxfoundry.com) as SUBMIT button for Gravity Forms?
    Will using a JS URL to call the forms submit() work?

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  2. I think your best bet if you are to go this route creating your stylization is to pinpoint the outputted CSS and apply it to the submit button selector on the form. Each form's submit button can be styled uniquely or uniformly depending on how you want to go and which selectors you choose to target.

    You can always use a site to do this for you as well, that will produce CSS to use:
    http://css3generator.com/

    You may be able to play around with this hook as well to use in conjunction:
    http://www.gravityhelp.com/documentation/page/Gform_submit_button

    But, just placing CSS seems to me to be the far easier and better option.

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  3. jeroenlh
    Member

    Thanks for the quick reply!

    MaxButtons are DIVs with all kind of code in it (multiple lines of text, images, etc.), so using their CSS looks a bit a problem to me.
    I'll give it a go with the submit button hook, that should work fine.

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  4. jeroenlh
    Member

    I got the integration working using the GForm submit button hook.
    In short:

    $gformButtons = array(
        1 => 'maxbutton:1',
    );
    
    add_filter('gform_submit_button', 'my_gform_submit_button', 10, 2);
    
    function my_gform_submit_button($button, $form) {
        if ($def = $gformButtons[$form['id']]) {
            list($type, $id) = explode(':', $def);
            $shortcode = "[{$type} id={$id}]";
            $btn = do_shortcode($shortcode);
            if ($btn !== $shortcode)
                $button = str_replace('href=', 'onclick="jQuery(\'#gform_'.$form['id'].'\').submit();return false;" href=', $btn);
        }
        return $button;
    }
    Posted 12 years ago on Tuesday May 1, 2012 | Permalink
  5. David Peralty

    That's great, I'm glad to hear it.

    Posted 12 years ago on Tuesday May 1, 2012 | Permalink

This topic has been resolved and has been closed to new replies.