Skip to content Skip to sidebar Skip to footer

Unobtrusive Validation Not Triggering When Using Submit() Function

In my view I have a button that submits the form: This is one of a few different buttons,

Solution 1:

You can call it manually as follows:

function submitForm(action) {
    var $form = $("#myForm");
    $form.action = "/Area/MyController/" + action;

    $.validator.unobtrusive.parse($form);
    $form.validate();

    if ($form.valid()) {
       $form.submit();
    }
}

Post a Comment for "Unobtrusive Validation Not Triggering When Using Submit() Function"