I want to show validation messages for my DOM elements for which the validation are written into Viewmodel:
My viewmodel code is as::
public class HotelDetailViewModel { public long DocumentHotelID { get; set; } [Required(ErrorMessage = "Please enter Check In Date")] public string CheckInDate { get; set; } [Required(ErrorMessage = "Please enter Room Type")] public string RoomType { get; set; } [Required(ErrorMessage = "Please enter Nights")] public int Nights { get; set; } }
I have also used the Razor Validators as:
@Html.ValidationMessageFor(Model => Model.CheckInDate)
But I want to do the Validation on client side itself, without doing any submit. Because I have two forms on page and only one form can be submitted and for other I haveto do something using Jquery on client side, that I am asking. Thanks in Advance.