Uncheck Radio Buttons When Navigating to Previous Page

Uncheck Radio Buttons on the previous page when navigating backwards through a form. This will require the user to make a fresh selection as the progress through the form again.

Only works when Soft Validation is enabled.

Instructions

  1. Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gppa-uncheck-radio-buttons-when-navigating-to-prev-page.js

/**
 * Gravity Perks // Page Tranisitions // Uncheck Radio Buttons When Navigating to Previous Page
 * https://gravitywiz.com/documentation/gravity-forms-page-transitions/
 *
 * Uncheck Radio Buttons on the previous page when navigating backwards through a form. This will
 * require the user to make a fresh selection as the progress through the form again.
 *
 * Only works when Soft Validation is enabled.
 *
 * Instructions:
 *
 * 1. Install this snippet with our free Custom JavaScript plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */
 $( '#gform_GFFORMID' ).on( 'softValidationPageLoad.gppt', function( event, newPage, oldPage ) {
	if ( oldPage > newPage ) {
		$( '#gform_page_GFFORMID_' + oldPage ).find( 'input[type="radio"]' ).prop( 'checked', false );
	}
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.