On the rendered form element, JavaScript is declared for the onsubmit attribute. This JavaScript finds all button elements that are a child of the form and disables them. Probably to prevent clicking a second time during the form post. Another common approach is is modal that displays a message.
ASP.net MVC and querySelectorAll.forEach
T.Zacks
3,986
Reputation points
What is the meaning of this line onsubmit = "this.querySelectorAll('button').forEach(i => i.disabled = false)",
using (Html.BeginForm("Login", "Default", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new
{
id = "idMyForm",
onsubmit = "this.querySelectorAll('button').forEach(i => i.disabled = false)",
@class = "form-signin",
role = "form"
}))
{
}
Thanks