I have a Rails Devise form that has javascript validation. When the user presses submit, the validation works and the user is refocused on the form where they need to be.
Look at my answer.
$button = $('#someId') $.rails.enableElement($button) $button.removeAttr('disabled')
https://stackoverflow.com/a/44318786/4349494