This is a kind of similar duplicate to some others here, but I think I\'m using event.preventDefault() correctly in this case.
Here\'s a JSFiddle you ca
I solved it this way, due my code is a little bit different this may be helpful for other people. My initial code looked like this.
My js function looked like
function enrollStudents() {
// Stop Form.
event.preventDefault();
// Other code
}
I had to pass the parameter event in the function call and receive it in the function.
js code:
function enrollStudents(event) {
// Stop Form.
event.preventDefault();
// Other code
}
I hope it helps.