I am using a partial view in that which is as follows:-
@using (Ajax.BeginForm("UpdateStatus", "Controller", new AjaxOptions
{
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "divCurrent",
OnSuccess = "cleanUp",
OnFailure = "statusUpdateFailure"
}))
{
<input id="statusChange" type="submit" value="Submit" class="button" />
}
Also on the click of submit button i want a handler like after one click it sets to disabled for few seconds so the user cannot click it again and i am doing that as follows:-
$('#statusChange').click( function () {
temporarilyDisableButton($this, 60000);
});
but in chrome i am having the issue that the ajax form submit doesnot work. Only disabling the button works.
I want to execute both of them together or if there is an alternate way i want to use that.
Please suggest.
Thanks
I’ve ran into a similar issue where some browsers will not submit the form if the submit button is disabled. You’re disabling the button altogether before it actually triggers the submit event.To get around this, you can either submit the form before disabling the button or hide the button temporarily instead of disabling it.
You will have to give the Ajax form a client id by passing in your Html options
new { id = "myAjaxForm" }.Then you can do this on click
Alternatively, you can get rid of your click event altogether and bind an event to the
submitfunction:There are countless ways to do this but the basic idea is that you don’t want to disable the submit button before it has a chance to trigger the event.