Answer the question
In order to leave comments, you need to log in
Is data: ['name='+name,'surname='+surname] spelled correctly?
<form method="post">
<input id="name" type="text" name="name" class="form-control" placeholder="Name">
<input id="surname" type="text" name="surname" class="form-control" placeholder="Surname">
<input id="button" type="button" value="Load">
</form>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$('#button').click(function(){
var name = $('#name').val();
var surname = $('#surname').val();
$.ajax({
url: 'Classes/User.php',
type:"POST",
data: ['name='+name,'surname='+surname]
});
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question