@model HelloWorldMvcApp.MainViewModel
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/mvc/4.0/jquery.validate.unobtrusive.min.js"></script>
@using (Html.BeginForm("Index", "Home",FormMethod.Post))
@for (int i = 0; i < Model.Students.Count; i++)
@*<input type="text" value="@Model.Students[i].ID" />*@
@Html.EditorFor(m=>m.Students[i].ID)
@Html.ValidationMessageFor(m => m.Students[i].ID)
@*<input type="text" value="@Model.Students[i].Name" />*@
@Html.EditorFor(m => m.Students[i].Name)
@Html.ValidationMessageFor(m => m.Students[i].Name)
@Html.DropDownListFor(m => m.Students[i].StateID, new SelectList(Model.Students[i].States, "ID", "Name", Model.Students[i].StateID), "-- Select States--", new { @class = "edit-mode" })
@Html.ValidationMessageFor(m => m.Students[i].StateID)
@Html.DropDownListFor(m => m.Students[i].CityID, new SelectList(Model.Students[i].Cities, "ID", "Name", Model.Students[i].CityID), "--Select States--", new { @class = "edit-model" })
@Html.ValidationMessageFor(m => m.Students[i].CityID)
<p><input type="submit" value="Submit" /></p>
$("span[class='field-validation-error']").each(function () {
$(this).addClass("hidden");//Add class hidden to hide @@Html.ValidationMessageFor(model => model.xyz) if using bootstrap , else use css
var inputID = $(this).attr("data-valmsg-for");//get the id of the input field for which this validation prompted
var validationMessage = $(this).html();//Get validation message for input filed which is prompted
//$("#" + inputID).tooltip({ 'trigger': 'hover', 'title': validationMessage });//Trigger the tooltip now, if using bootstrap.
$("#" + inputID).attr("tooltip",validationMessage);