Skip to content

Instantly share code, notes, and snippets.

@sewmyheadon
Created December 6, 2017 17:45
Show Gist options
  • Save sewmyheadon/3efe633ccf1589f2f6374de318b002c8 to your computer and use it in GitHub Desktop.
Save sewmyheadon/3efe633ccf1589f2f6374de318b002c8 to your computer and use it in GitHub Desktop.
When a required field is missing upon checkout, this uses jQuery to scroll to the top.
/**
* Jump to error in EE checkout
*/
function ee_test_click_event_handler(){
wp_add_inline_script(
'ee_form_section_validation',
'jQuery( "#spco-go-to-step-finalize_registration-submit" ).click(function( event ) {
alert( "Handler for .click() called." );
});'
);
}
add_action( 'wp_enqueue_scripts', 'ee_test_click_event_handler', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment