I have an MVC view with a form built with the Ajax.BeginForm() helper method, and I\'m trying to validate user input with the jQuery Validation plugin. I get the plugin to h
Try adding an OnBegin callback to the AjaxOptions and return the value of $('form').validate().form() from the callback. Looking at the source it appears that this should work.
function ajaxValidate() {
return $('form').validate().form();
}
<% using (Ajax.BeginForm("Post", new AjaxOptions
{
UpdateTargetId = "GBPostList",
InsertionMode = InsertionMode.InsertBefore,
OnBegin = "ajaxValidate",
OnSuccess = "getGbPostSuccess",
OnFailure = "showFaliure"
}))
{ %>
EDIT updated with correct callback name.