Following is the form
@using (Html.BeginForm(MVC.CollectionPlanConfirmation.ActionNames.Edit, MVC.CollectionPlanConfirmation.Name, FormMethod.Post, new { @id = "collectionPlanForm" }))
{
.................
}
Submit button is outside Form. Following is the submit button on my MVC view.
<input type="submit" value="Save" class="aSubmit" onclick="return SubmitForm();" />
Following is the jquery that should submit the form.
<script type="text/javascript">
function SubmitForm() {
...... validation code........
$('#collectionPlanForm').submit();
}
</script>
I could see, IE8, and Firefox submitting the form, but it doesn't go well with Chrome. It doesn't do anything at all.
What could be the reason, and how to fix it?
Any help on this, much appreciated.
Thanks
The best way to perform a submit for jquery is in this way.
http://jsfiddle.net/BD3Rt/
Always nice to keep html clean and separate your jquery/javascript code.
put ID for form and use
$("#yorID").submit()
and you can see the example here exampleTry this:
HTML
SCRIPT
DEMO FIDDLE