Skip to content

Instantly share code, notes, and snippets.

@landbryo
Created April 23, 2020 22:29
Show Gist options
  • Save landbryo/c5156eb121030ba1a643f7d60e281b62 to your computer and use it in GitHub Desktop.
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.
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