I want to submit the form data to the database, 2 seconds after the user has entered the data in the form
I am using ajax function to accomplish this.but form gets submitted when a press a single key
$('#eid').bind('input propertychange', function() {
$.ajax({
method: "POST",
url: "intime2.php",
data: { content: $("#eid").val() }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
});
When I enter the employee ID=12 in the form. I expect the result to be stored in database as 12 but the result stored is 1. before pressing 2 the data is submitted. I also want the form to be refreshed automatically for every consecutive submissions.
My goal: employees should enter their employee id(I am going to take inout from card reader, but for now I like to use timeout function) after entering the form should auto submit without them pressing the submit button then the form should refresh and next employee should enter his employee ID