Javascript to reset a form and go to the first page

I have a multi-page form with conditional logic on the pages. I want to have a link on the last page that goes back to the first page and resets all form inputs after page 2 or reset the whole form if that is not possible. I currently have a click event that will show the first page using the jQuery/javascript below. But clicking the next button submits the form instead of going to page 2. Is there some way to tell gravity forms we’re back on the first page?

$(‘.gform_page:eq(0)’).show();
$(‘.gform_page:not(:eq(0))’).hide();

Hi @rumor

I didn’t find a way to reset the entire form and start from the first page. However, adding the following code in an HTML field before the submit button will help you reset the current page’s form data, as shown in the screen recording below.

CleanShot 2024-12-27 at 12.24.40

Code:

<input type="reset" value="Clear Form" />

Source:

Give it a try, and let me know how that goes!

Thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.