I have a registration form that works, that when executed successfully calls Limpiar
that makes the form blank, but if I put the the OnBegin
form stops working completely
@using (Ajax.BeginForm("Registrar", "", new AjaxOptions
{
HttpMethod = "POST",
//OnBegin = "Iniciar",
OnSuccess = "Limpiar",
UpdateTargetId = "div_tabla_sucursal",
InsertionMode = InsertionMode.Replace
}
In a script I have the following:
function Iniciar () {
// Deshabilitamos el botón de Submit
$("#btn_registrar").prop("disabled", true);
};
var Limpiar = function () {
// Limpia el formulario
$("#Frm_Registro").trigger("reset");
// Habilitamos el botón de Submit
$("#btn_registrar").prop("disabled", false);
// Mostramos un mensaje de éxito.
$("#ExitoAlert").show("slow").delay(2000).hide("slow");
};
the first time it was executed correctly and if it did not make any modifications it stopped executing, when I remove it onBegin
from the form onSuccess
it executes without problems, but when I place it it stops working completely.