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

192
Views
get form field array value and post them using ajax like form submit

Please anyone can help me to get form field array value and post them using ajax like form submit

From Fields like this :-

<input  name="employment_Details[0][companyname]" >
<input name="employment_Details[0][companyemail]" >
<input name="employment_Details[0][companyphone]" >
<input name="employment_Details[1][companyname]" >
<input name="employment_Details[1][companyemail]" >
<input name="employment_Details[1][companyphone]" >

javascript goes here :-

<script type="text/javascript">
var formdata = /* form data goes here i mean form fields value*/'

Xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhttp.open("POST", "submit.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("form_submit=true&formdata=" + formdata); 
<script>

php goes here :-

<?php
print_r($_POST['formdata']);
?>

Results : Expected results look like this

Array ( 
[0] => Array ( 
[companyname] => companyname goes here 
[companyemail] => companyemail goes here
[companyphone] => companyphone goes here )

[1] => Array ( 
[companyname] => companyname goes here 1
[companyemail] => companyemail goes here 1
[companyphone] => companyphone goes here 1)

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