I have like 143 form fields (text, textarea and select) that I would like to send through an AJAX post request. Is there a way I can do this quick without manually add every field to the query?
Alright so I've set up thing like this:
jquery
$("#submitbtn").click(function(){
$.ajax({url: "check_data.php", data: $("#form").serialize(), success: function(result){
alert(result);
}});
});
The form is declared like this:
<form class="pure-form" onsubmit="return false;" method="POST" id="form">
I tried also without the "return: false"
And the button as follow:
<button id="submitbtn" class="pure-button pure-button-primary">INSERT</button>
But it does not work, when I press the button I get no js or network activity whatsoever on the console, and nothing happens.