The callback function passed as an argument to the handleSubmit
function takes 2 parameters: data and event. I think now you can easily handle the situation raised in your form. Just place event.preventDefault()
at the first line of your callback function; but, be assured that you're passing two parameters to the callback function you're using, not one.