I'm trying to delay the submission of a form but only when i trigger the submit after the delay it does not send the post values.
this is my html
<form id="form_anim" name="form" autocomplete="off" action="index.php" method="POST">
<input name="username" id="username" type="text" placeholder="Nome utente" autofocus required>
<input name="password" id="password" type="password" placeholder="Password" required>
<a href="#">Hai dimenticato la password?</a>
<input id="invio" name="invio" type="submit" value="Accedi">
</form>
and this is the script
$('#form_anim').on('submit', function (event, force) {
if (!force) {
var $this = $(this);
event.preventDefault();
setTimeout(function () {
$this.trigger('submit', true);
}, 2000);
}
});
help me please.