Skip to content

Conversation

@tcbegley
Copy link
Collaborator

@tcbegley tcbegley commented May 1, 2021

As requested in #553

Example usage:

import dash
import dash_bootstrap_components as dbc
from flask import request

app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = dbc.Container(
    dbc.Form(
        [
            dbc.Input(name="input"),
            dbc.Button("Submit", name="submit", value="submitting"),
            dbc.Button("Submit alt", name="submit-alt", value="submitting-alt")
        ],
        method="POST",
        action="/test",
        id="form",
        prevent_default_on_submit=False,
    ),
    className="p-5",
)


@app.server.route("/test", methods=["POST"])
def test():
    return request.form


if __name__ == "__main__":
    app.run_server(debug=True)

@tcbegley tcbegley merged commit f7a2648 into main May 1, 2021
@tcbegley tcbegley deleted the button-value branch May 1, 2021 13:16
This was referenced May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants