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?
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?
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.
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.
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;
}
That's great, I'm glad to hear it.