Vote count:
0
I try to submit a form after my ajax request done. I do code like following. But when I click the button ajax request is go to and send 200 ok feedback. But after that form not submit. What is wrong on this code?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$('document').ready(function(){
$('#submit').on('click',function(){
$.post('cart.php',{email:'email',pkgname:'pkgname'}).then(function(){
$('form').submit();
});
});
});
</script>
</head>
<body>
<form action="cart.php" method="post">
<input type="button" id="submit" value="submit" />
</form>
</body>
</html>
asked 3 mins ago
Jquery form submission is not working
Aucun commentaire:
Enregistrer un commentaire