Попытка избежать множественного представления на кнопку отправки, используя атрибут disabled
, но при щелчке по нему просто блокируйте кнопку, и ничего не происходит. Попробовали добавить id
в Html.Begin форме, но на кнопку дает ошибку сервер приложений, как: the parameters dictionary contains a null entry for parameter 'id' of non-nullable type System.Int32
кнопка блока на форме отправки
@using (Html.BeginForm(MVC.Controller.MethodName(), FormMethod.Post, new { id = "submitFormId" }))
<button class="btn btn-w-m btn-primary" type="button" id="submitButtonId" value="AddSmth" onclick="return validateForm(event)">
<i class="fa fa-plus"></i> Add
</button>
И ЯШ:
$("#submitButtonId").attr("disabled",true);
$('#submitFormId').submit();
http://stackoverflow.com/questions/926816/how-to-prevent- form-from-submitting-multiple-times-from-client-side –
@mplungjan не работает для меня – Vitaliy