Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda