I have a simple form with two inputs
and a button to send it. I am trying to make the submit not work by default to be able to do things with the data before sending it to the server but, I do not know why, I can not avoid the submit.
I guess in the end it will be silly but I can not find it ...
Here the form
<form id="formID">
<input type="email" id="loginName" placeholder="Usuario" required autofocus>
<input type="password" id="loginPass" placeholder="Contraseña" required>
<button type="submit">Enviar</button>
</form>
I've also tried with action="/"
but it's still the same.
Here the jquery
$('#formID').on('submit', function (event) {
event.preventDefault();
});
I've also tried it with $("#formID").submit(function(event){});
and return false
but it's still the same, when you hit the button or "enter" the page is reloaded.
I do not know what else happens to me to try ... Any ideas?