Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda