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

188
Views
Form post in a new tab using JavaScript

I am trying to post a form in a new window using JavaScript.

let form  = document.createElement('form');
form.target = 'example.com';
form.method = 'POST';

form.submit();
window.open('', form.target);

The above code submits the form in a new window. This solution works fine until someone navigates to a different URL in the new tab. Let's say google.com. On Subsequent click, this does not work as it stays on google.com instead of posting to example.com.

I need to post a www-url-form-encoded content-type in a new window and keep the reference of the tab so subsequent clicks opens the same tab if it is already opened.

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!