Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
How to call two urls with one submit button to get form data

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>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!