How to prevent auto-submission of form after initial "submit" button press?

I have a form that updates an SQL database when a ‘submit’ button is pressed. If any of the form inputs are missing, submission will be disallowed until the user fills in all the inputs. The problem, however, is after the submit button is pressed a single time, regardless of success/failure, when the form is filled again it automatically submits without pressing the “submit” button, and this behavior persists until the page is refreshed. Can anyone see what I’m missing?

@callback(
    Output('output-provider', 'children'),
    Output('lot-number','value'),
    Output('production-date','value'),
    Output('membrane-lot','value'),
    Input('commit-to-database-button', 'submit_n_clicks'),
    Input('lot-number','value'),
    Input('production-date','value'),
    Input('membrane-lot','value'),
)
def update_prod_database(submit_n_clicks, lot, prod_date, memb_lot, memb_lot_cut):
    if not submit_n_clicks:
        return '', no_update, no_update, no_update
    else: 
        engine = connect_mariadb()

        var_list = [lot, prod_date, memb_lot, memb_lot_cut]
        # Generate True/False values for each input on form.
        bool_list = [(x is not None and x != '') for x in var_list]

        # Sums bool values in bool_list. If any inputs are missing, sum will be less than 4
        if sum(bool_list) == 4:
            df = pd.DataFrame(
                {
                    'lot': [lot], 
                    'date_of_production': [prod_date], 
                    'membrane_lot': [memb_lot], 
                    'membrane_lot_cut': [memb_lot_cut]
                }
            )

            df.to_sql(
                name="membrane_spray_prod_results", 
                con=engine, 
                if_exists="append", 
                index=False)

            return "Submission successful. You may close this form or enter new values.", '', '', '', ''
        else:
            return "Submission failed. Please double-check values and try again.", no_update, no_update, no_update, no_update,
@app.callback(
    Output(...), Output(...),
    Input(...), Input(...),
    State(...)
)
def callback(a, b, c):
    return [a + b, b + c]

Check the docs, take a moment to understand how callbacks work, especially the State part.

And it would be better to use dash.exceptions.PreventUpdate to prevent updates.

You can also try to use validation or related properties of the components to assist with submission.

In my experience, it’s better to submit to the database with a timestamp and user ID.

Thank you for the help! Using State solves my initial problem.