I have a form with several different information about an user:
<form action="" method="post">
<input type="text" id="input-name" placeholder="Name" name="nameD">
<input type="text" id="input-surname" placeholder="Surname" name="surname">
<input type="text" id="input-name" placeholder="City" name="city">
<input type="text" id="input-name" placeholder="Address" name="address">
<input type="text" id="input-name" placeholder="Zip Code" name="zipcode">
<input type="text" id="input-name" placeholder="State" name="stateR">
<input type="text" id="input-name" placeholder="VAT" name="vat">
<input type="text" id="input-name" placeholder="Fiscal Code" name="fiscalcode">
<input type="email" id="input-email" placeholder="Email address" name="email">
<input type="text" id="input-name" placeholder="Bank Account" name="bankaccount">
<input type="text" id="input-name" placeholder="Bank Name" name="bankname">
<input type="text" id="input-name" placeholder="Phone" name="phone">
<input type="submit" class="btn btn-primary" onclick="doCreate_User()" value="Create">
and by clicking on the create button I call a Javascript function "doCreate_User()".
function doCreate_User(){
//Actually empty
}
Now, I have a PHP function:
function create_user($name,$surname,...ect){
//here using INsert into TableX() Values();
}
used to insert within a mysql table the variables taken in input from the form.
Which could be a suitable Javascript function able to pass all data from the form (in HTML, given the event triggered by the onclick) to PHP function create_user?
Thanks in advance