I have a button like this
There some other ways as given below
1: you can call a function on form submission. Just Add onsubmit="myFunction()"
with function name (e.g myFunction) in form tag. As given below
2: you can also call this function by adding onclick="myFunction()"
in submit button.
I am sure one of these will solve your issue.