Validation in MVC page does not work in IE
After using validation in MVC pages, once the validation message is displayed IE hangs but in mozilla it is working. What would be the problem? Please suggest the solution.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Ankur GuptaRank #1,017 · 1.9K reputationPosted Jun 2, 2010, 1:33 AM EDT
prasanna3 reputationPosted Jun 2, 2010, 8:53 PM EDT
<td class="tar">
<%= LabelHelper.MultilingualLabel(ViewData["displayText"].ToString() + "Name", "name")%>
td>
<td>
<%= Html.TextBoxFor(m => m.Name, new { @class = "textbox140" })%>
<%= Html.ValidationMessageFor(m => m.Name, "", new { Style = "display:none" })%>
td>
2. Jquery to handle the error: validForm(form) will be called before posting the data
function validForm(form) {
var errs = Sys.Mvc.FormContext.getValidationForForm(form).validate('submit');
$("#Validations").show();
return (!(errs && errs.length));
}
3. The div which is used to display error
<div class="errorMessage" id="Validations" style="display: none">
<div class="msgIcon">
<img src="../../../Content/main/images/errorIcon.gif" alt="Error" title="Error" class="msgBtn" />div>
<div class="errorText" id="Div5">
<%= Html.ValidationSummary(false,"Please correct the errors and try again.") %>