Sorry for my english..
I have a button:
< a class=”button” href=”http://mysite.com/mvc3controller”>< span>Submit< /span>< /a >
Submit
And a script on template page:
<script type="text/javascript">
$(document).ready(function () {
$(".submit-link").click(function () {
$(this).closest("form").submit();
});
});
</script>
I need to send form and display answer, but for some reason it does it with AJAX.
So, script gets right result and doesn’t do anything more.
It doesn’t do AJAX. The .submit method simply triggers any subscribed events. If you have subscribed to it and AJAXified the form that might explain why an AJAX query is being sent. If you want to call the underlying event without calling any registered handlers you could call the native submit event on the DOM element and not jQuery’s submit method: