jeudi 13 octobre 2016

Validation for multiple partial views not working

I have a view with Tuple model. I'm loading 4 partial views in this main view as below

  1. @Html.Partial("~/Views/Partial/_Tab1Input.cshtml", Model.Item1.Tab1Input)
  2. @Html.Partial("~/Views/Partial/_Tab2Input.cshtml", Model.Item1.Tab2Input)
  3. @Html.Partial("~/Views/Partial/_Tab3Input.cshtml", Model.Item1.Tab3Input)
  4. @Html.Partial("~/Views/Partial/_Tab4Input.cshtml", Model.Item1.Tab4Input)

I'm loading these partial views on tab click. On click of submit, only active Tab is getting validated. Means if I'm in tab 2 partial view and clicked on submit, then required field validation will happen, but tab 1 partial view's validation will be ignored, and the form is getting Posted.

Please assist me so that on click of submit, all 4 partial views required field validation should happen.

Aucun commentaire:

Enregistrer un commentaire