Created
April 23, 2020 22:29
-
-
Save landbryo/c5156eb121030ba1a643f7d60e281b62 to your computer and use it in GitHub Desktop.
Ugly but useful function to hook to a button or link allowing you to skip the current page/step. Basically just a useful UI snip.
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
function gfSkipStep(e) { | |
e.preventDefault(); | |
jQuery('.gform_wrapper:visible .gform_page').each(function () { | |
if (jQuery(this).is(":visible")) { | |
if (jQuery(".gform_button[type=submit]").is(":visible")) { | |
jQuery(".gform_button[type=submit]:visible").trigger('click'); | |
} else if (jQuery(".gform_next_button").is(":visible")) { | |
jQuery(".gform_next_button:visible").trigger('click'); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment