Further to my problem here - jQuery on submit validation, with modal dialog at the end?
It seems like the form simply will not submit using jQuery. Here's my code at a very simplified level:
<script type="text/javascript">
$(document).ready(function(){
$(document).click(function() {
$('#inputform').submit();
});
$("#inputform").submit(function() {
alert('test');
return true;
});
});
</script>
<form method="POST" action="<?php echo CURRENT_PAGE ?>" id="inputform">
<button type="submit" name="submit" id="submit">Submit form</button>
</form>
Clicking on the body displays the 'test' alert but doesn't submit the form. Also, upon closing the alert box, it won't re-appear when you click again.
Simply clicking on the submit button itself displays the alert then submits the form as expected.
Sorry for what is (I know) a really stupid question, but I'm at a loss here. TY!
$("#inputform").submit(function() {return true;});