So I have this simple test case where a form cannot be submitted via jQuery when there is a button with type submit and an ID submit in the form.
If you change the ID to something else, jQuery can easily submit the form.
What is happening here?
$('#submitform').on('click', () => {
$('form').submit();
});
$('form').on('submit', () => {
alert('submit')
});
<!DOCTYPE HTML>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
</head>
<body>
<button id="submitform">JS-Submit</button>
<form action="#" id="validation" novalidate>
<input type="text" name="someinput" />
<!-- change ID to anything other than "submit" to be able to submit form via JS -->
<button type="submit" id="submit">Submit</button>
</form>
</body>
</html>