I have three textboxes and i need to check if one of field is not enter and display error(just one error). Is this possible with MVC validation or i need javascript validation?
@Html.TextBoxFor(m => m.Register.Day, new { id = "day_birthdate" })
@Html.TextBoxFor(m => m.Register.Month, new { id = "month_birthdate"})
@Html.TextBoxFor(m => m.Register.Year, new { id = "year_birthdate" })
Model:
public int? Day { get; set; }
public int? Month { get; set; }
public int? Year { get; set; }
I dont want to get three different errors...I dont want this
@Html.TextBoxFor(m => m.Register.Day, new { id = "day_birthdate" })
@Html.ValidationMessageFor(m => m.Register.Day)
@Html.TextBoxFor(m => m.Register.Month, new { id = "month_birthdate"})
@Html.ValidationMessageFor(m => m.Register.Month)
@Html.TextBoxFor(m => m.Register.Year, new { id = "year_birthdate" })
@Html.ValidationMessageFor(m => m.Register.Year)