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

82
Vistas
POST content is empty at reception

I have a string that I would like to pass from JS to PHP via a hidden input, but the POST form does not return anything at arrival (I checked it with a var_dump($_POST)), which never happened to me at all.

Here is my HTML code:

<form action='' id='hash-form'>
    <input type='hidden' id='hash' name='hash'/>
</form>

Here is my JS code for changing the value and submitting:

document.getElementById("hash").value = content;
console.log(document.getElementById("hash").value);
document.getElementById("hash-form").submit();

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The form lacks of the method attribute, thus it's GET by default, not post.

Add method="POST" into a form tag.

What is the default form HTTP method?

about 4 years ago · Juan Pablo Isaza Denunciar
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