title: How to call two urls with one submit button to get form data
body: <p>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.<br />
  Expected solution --&gt;  when I click on submit button file has to upload along with map2 has redirect to mapRedirect url.</p>
  <pre><code>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&quot;map2&quot;)
  
  @app.route('/proc')
  def upload_file():
      ## file upload script
      return render_template('proc.html')
  </code></pre>
  <p>map2.html</p>
  <pre><code>&lt;iframe name = &quot;Ifrmp&quot;, id='mp', src=&quot;map2&quot; &gt;
  </code></pre>
  <p>proc.html</p>
  <pre><code>&lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; target=&quot;Ifrmp&quot;&gt;
  &lt;input type=&quot;submit&quot; id='btn' name=&quot;nm&quot; value=&quot;submit&gt;
  </code></pre>