Here my code for multiple text input in looping:
<?php
while($row_markah = mysql_fetch_array($result_markah))
{
?>
<input class="form-control" name="markah[]" value="<?php echo $rows_markah ['markah'];?>" onkeypress="return isNumberKey(event)" onchange="javascript: submit();">
<?php
}
?>
I want to auto submit first text input after go to next text input without submit button and without refresh the page.
Can someone help me to solve this problem?
Thank You.
You need to create a ajax call for your first input onBlur
..you can take this and adapt as you need.
$(document).ready(function() {
$(".firstInput").blur(function() {
$.ajax({
method: "POST",
url: "url you need to submit",
data: { dataName: "dataValue" }
})
.done(function(response) {
alert("Back from server");
$(".secondInput").focus();
});
});
});
check this https://jsfiddle.net/ers5hx7p/ as well to help you understand how things work with jquery / ajax. hope that helps.