Hi,
i'm trying to submit my Ajax form using jQuery. However calling the submit() function causes the entire page to refresh. It should just execute the onSubmit part of the form (which returns false
so that the page shouldn't refresh).
<%Ajax.BeginForm("AllocateAndUpdateMech",
New With {.Controller = "Planning",
.Id = Model.Id},
New AjaxOptions With {
.LoadingElementId = "loading",
.UpdateTargetId = Model.Id & "_alloc"},
New With {.id = "allocate_" & Model.Id & "_" & item.UserId}
)%>
<%Html.Hidden("mechId", item.UserId)%>
<a href="javascript:void(0);" onclick="$('#<%="allocate_" & Model.Id & "_" & item.UserId %>').submit();">Allocate: <%=item.UserName%></a>
<%Html.EndForm()%>