Sometimes this can happen when there’s syntax error in the code. See if there isn’t any error displayed in the console (also in the browser’s console).
I re-wrote the code and the submit button worked. It was definitely a syntax error. Thanks.