Skip to content

Instantly share code, notes, and snippets.

@geekontheroad
Last active September 3, 2024 03:20
Show Gist options
  • Save geekontheroad/89843b5cda3332673b52ef75633c34c5 to your computer and use it in GitHub Desktop.
Save geekontheroad/89843b5cda3332673b52ef75633c34c5 to your computer and use it in GitHub Desktop.
<?php
/**
* This is a simple snippet to add a reset button to the Gravity Forms and trigger the refresh of the summary
* Meant to be used with the Gravity Forms Live Summary add-on (https://geekontheroad.com/live-summary-for-gravity-forms/)
*
* @author Johan d'Hollander
* @link https://geekontheroad.com
**/
add_filter( 'gform_submit_button_51', 'form_submit_button', 10, 2 );
function form_submit_button( $button, $form ) {
$button .= '<input type="reset" value="Clear Quantities" onclick="gotrLiveSummaries.debouncedRefresh(51)">';
return $button;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment