my code:c#
@using (Ajax.BeginForm("tt", null, opt, new { @class = "form-horizontal", @id = "AddForm" }))
{
....
<input id="submit" type="submit" class="btn btn-primary" value="Add">
}
AjaxOptions:
AjaxOptions opt = new AjaxOptions
{
InsertionMode = InsertionMode.ReplaceWith,
HttpMethod = "POST",
UpdateTargetId = "Add-Student",
OnBegin = "OnBegin",
OnSuccess = "ModelHideFormSubmit"
};
script: it works in first submit, but after first submit and success massage appeared , then want to submit again the code not working any more!! why??
function OnBegin() {
$("#AddForm :submit").prop("disabled", true);
$("input[type='submit']", "#AddForm").val("saving...");
}