Forked from yanknudtskov/gravityforms-auto-trigger-next-previous.js
Created
June 18, 2018 06:33
-
-
Save INDIAN2020/82f4c10f11115652dc437cffd15ab5a2 to your computer and use it in GitHub Desktop.
jQuery example to trigger next/previous buttons on GravityForms #gravity-forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is the initial GravityForms binding, it will be lost upon a page change with next/previous | |
| // Thus we make a bind on gform_page_loaded event also | |
| if( jQuery('.custom-form').length > 0 ) { | |
| jQuery('.gfield_radio input[type=radio]').bind("click", function() { | |
| //console.log('Clicked: ' + jQuery( this ).closest('.gform_page').find('.gform_page_footer .gform_next_button.button') ); | |
| jQuery(this).closest('.gform_page').find('.gform_page_footer .gform_next_button.button').click(); | |
| }); | |
| } | |
| jQuery(document).bind('gform_page_loaded', function(event, form_id, current_page){ | |
| // code to be trigger when next/previous page is loaded | |
| if( jQuery('.custom-form').length > 0 ) { | |
| jQuery('.gfield_radio input[type=radio]').bind("click", function() { | |
| //console.log('Clicked: ' + jQuery( this ).closest('.gform_page').find('.gform_page_footer .gform_next_button.button') ); | |
| jQuery(this).closest('.gform_page').find('.gform_page_footer .gform_next_button.button').click(); | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment