I create a site using Flask, and on one page I have two forms. If there is a POST, I need to decide which form is being submitted. I can, of course, subtract it from the fields present in request.form , but I would rather make it explicit by getting the name (defined by <form name="my_form"> ) of the form that was submitted. I tried several things, for example:
@app.route('/myforms', methods=['GET', 'POST']) def myForms(): if request.method == 'POST': print request.form.name print request.form.['name']
but unfortunately nothing works. Does anyone know where I can get the name of the submitted form? All tips are welcome!
source share