PHP form submission

0

I have a form where name="" fields have values different from [ ] because of an API I'm using. I was wondering how can I get this input value to send to an email?

<form id="msform" method="post" action="send.php" enctype="multipart/form-data">
 <input id="nome_completo" name="curriculo[nome_completo]" minlength="5" type="text" class="form-control" placeholder="Nome Completo*">
</form>    
    
asked by anonymous 05.07.2018 / 15:00

1 answer

0

You can do with JavaScript and get value:

function getFormSubmitValues(formId){ 
     document.getElementById(formId).addEventListener('submit', function(e){
     e.preventDefault();
     const queryMyInput = document.querySelectorAll("#" + document.getElementById(formId).id + ' input');
		queryMyInput.forEach(function(n){
      //return n.value;
      console.log(n.value);
		});
	});
}

getFormSubmitValues('msform');
<form id="msform" method="post" action="send.php" enctype="multipart/form-data">
 <input id="nome_completo2" name="curriculo1[nome_completo]" minlength="5" type="text" class="form-control" placeholder="Nome Completo*">
 <button>Enviar</button>
</form>

After getting this value, you can then use Ajax to submit the form! If you do not know how to use it, I can edit the answer later and explain.

    
05.07.2018 / 15:34