onkeyup ajax post twice to sql
twice data to sql
insert data to sql twice redcord
function myFunction() {
var x = $("#number_2").val();
if(x.length === 2){
$.ajax({
type: "POST",
url: "insert2.php",
data: {message: x},
success: function(data) {
$('#number_2').val('')
}
});
}
}
<input type="text" id="number_2" onkeyup="myFunction()" class="text-center fast form-control" >
2
Answers
This code works.
HTML
JavaScript