# Refresh all Tables When Form is Submitted

> Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

Source: https://tadabase.com/docs/snippets/refresh-all-tables-when-form-is-submitted  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

> **Warning:** Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add this functionality is through the plugin installation wizard. Learn more about plugins [here](https://tadabase.com/docs).

![Refresh all components when form is submitted](https://community.tadabase.io/uploads/default/original/1X/007d6e8bcb6e501daee87e43f8a54249f2703c09.gif)

This is a solution to refresh only the tables after a form's submit button is clicked without refreshing/reloading the entire page.

**Step 1**

**On the live app, find your form's ID.**

![Screenshot for “Refresh all Tables When Form is Submitted”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-09/scaled-1680-/2022-09-16_22-39-27.png)

**Step 2**

**Add the following code to the JavaScript tab of the page.**

```
var submitButtonLoaded = false;
var formID = 'x_element_page_X_XX'; // Change this to the ID of the form you are submitting
var timeToWait = 500; // Number of milliseconds to wait before refreshing the tables
function checkIfSubmitButtonHasLoaded() {
    if (submitButtonLoaded === false) {
        if ($('#' + formID + ' .form-submit button').html() !== undefined) {
            submitButtonLoaded = true;
        }
        window.setTimeout(checkIfSubmitButtonHasLoaded, 100);
    } else {
        $('#' + formID + ' .form-submit button').click(function() {
            setTimeout(function() {
                $('[ng-click="refreshData()"]').click();
            }, timeToWait);
        });
    }
}
checkIfSubmitButtonHasLoaded();
```

![Screenshot for “Refresh all Tables When Form is Submitted”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-09/scaled-1680-/2022-09-16_22-44-16.png)

**Original Community Post:**

[JS - Refresh Tables Only - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/js-refresh-tables-only/385/5)
