---
title: "Reset any form using jQuery"  
description: "Reset any form using jQuery"  
author: "Ethan Karla"  
published: 2021-07-28  
updated: 2023-06-14  
canonical: https://www.mindstick.com/forum/156660/reset-any-form-using-jquery  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# Reset any form using jQuery

How to reset any [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) using jQuery?

## Replies

### Reply by Aryan Kumar

Sure, here is how you can reset any form using jQuery:

Code snippet

```plaintext
// Get the form element
var form = $("#form_id");

// Reset the form
form.reset();
```

The reset() method of the Form object resets all of the form elements to their default values. This includes text input fields, select boxes, and radio buttons.

For example, the following code will reset the form with the ID myForm:

Code snippet

```plaintext
$("#myForm").reset();
```

This will reset all of the form elements in the form to their default values.

You can also use the reset() method to reset a form that is not currently displayed on the page. For example, the following code will reset the form with the ID myForm even if it is not currently displayed:

Code snippet

```plaintext
$("#myForm").load("myForm.html").reset();
```

This will load the form with the ID myForm from the file myForm.html and then reset it.

The reset() method is a useful way to clear all of the data from a form. This can be useful for forms that are used to collect data from users, such as contact forms or registration forms.

Here are some other things to keep in mind when using the reset() method:

- The reset() method does not clear the form's submit button. If you want to clear the submit button, you can use the .val() method to set its value to an empty string.
- The reset() method does not clear the form's hidden fields. If you want to clear the form's hidden fields, you can use the .val() method to set their values to empty strings.
- The reset() method does not clear the form's validation errors. If you want to clear the form's validation errors, you can use the .validate() method to reset the form's validation state.


---

Original Source: https://www.mindstick.com/forum/156660/reset-any-form-using-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
