I have a view that is processing some crud operations on button clicks. The issue is since the operations are time-consuming, the user is pressing the submit button frequently & which adds duplicate records.
How can I disable the submit button until the actions are performed and enable it?
<div class="form-container">
<div class="formBox">
<div class="row">
<div class="col-md-6">
<div class="inputBox ">
<div class="inputText">الاسم الاول (First Name)</div>
@Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "input",@maxlength="15" } })
@Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" })
</div>
</div>
<div class="col-md-6">
<div class="inputBox">
<div class="inputText">الاسم الاخير(Last Name)</div>
@Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "input", @maxlength="15" } })
@Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" })
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="inputBox">
<div class="inputText">البريد الإلكتروني(Email)</div>
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "input", @maxlength="30" } })
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>
</div>
<div class="col-md-6">
<div class="inputBox">
<div class="inputText">رقم الجوال(Mobile(05XX))</div>
@Html.EditorFor(model => model.ContactNo, new { htmlAttributes = new { @class = "input", @maxlength="10" } })
@Html.ValidationMessageFor(model => model.ContactNo, "", new { @class = "text-danger" })
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type="submit" name="" class="button" value="حفظ /Save">
</div>
</div>
</div>
</div>
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(Registration registration)
{
if (ModelState.IsValid)
{
}
}