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

118
Views
Submit form to new tab and close it right away

I have a form with "target" set to "_blank" in order to open a new tab when the form is submitted. The action of this form is an aspx page that does server-side processing and returns an html. I am trying to figure out whether it's possible to close the new browser tab right away without waiting for the returned html.

Thanks for any idea.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There's a window.close() property that comes with the browser API. Not sure how you're setting up your server-side processing, but you can listen for an event on that browser tab and fire off the window.close() when the HTML is returned from your server.

Combining this with the onLoad event, you should be able to pull this off:

window.addEventListener('load', e => {
    window.close();
});
about 4 years ago · Juan Pablo Isaza Report
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!