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

81
Views
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 answers
Answer question

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 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!