Add Reset button to your Gravity Forms

Hi folks, I ran into a situation where I had to add the Reset button in Gravity Form that I’ve been using in the site as per the mockup. Turns out that here is no default option to add this “Reset” button.
So on my quest for this, doodling around documentation
As explain here: https://docs.gravityforms.com/gform_submit_button/

All you have to do is put this line of code in your functions.php file

You can also target the specific Gravity form by specifying/adding ID in the shortcode itself. In this case “2”

// Adding a reset button to Gravity form
add_filter( 'gform_submit_button_2', 'form_submit_button', 10, 2 );
function form_submit_button( $button, $form ) {
	$button .= '<input type="reset" value="Clear Fields">';
	return $button;
}

Of course do some styling. Here is my form after adding reset button. Take care.

Comments are closed.