I can submit one input field data through ajax to a php file and then that php file update it in database. Last portion of code i write for ajax in javacript is below
parameter = 'create_name='+document.create_user_cl.create_name.value;
xmlhttp.open('POST', 'php/add_user.php', true);
xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlhttp.send(parameter);
Everything works uptil here.
Now I have multiple input fields like name, username, password etc and i want to submit all input field's data via post through Ajax to the php file but i don't know how should i modify that parameter
variable or xmlhttp.send()
so that i can send multiple input field data. I can do it with GET
but i want to achieve this through POST
. I am new to ajax, please help