I am trying to perform two different functions with single submit button, the below script shows the example of what I am trying to get. Thank you for helping me.
Expected solution --> when I click on submit button file has to upload along with map2 has redirect to mapRedirect url.
from flask import flask, render_template, flash, request, redirect,url_for
@app.route('/map2')
def map_2():
return render_template('map2.html')
@app.route('/mapRedirect', methods = ['POST', 'GET'])
def onMap():
if request.method == 'POST':
name = request.form['nm']
return redirect(f"map2")
@app.route('/proc')
def upload_file():
## file upload script
return render_template('proc.html')
map2.html
<iframe name = "Ifrmp", id='mp', src="map2" >
proc.html
<form method="post" enctype="multipart/form-data" target="Ifrmp">
<input type="submit" id='btn' name="nm" value="submit>