Validation errors are visible when I access the page before I post the form

Posted by Liado on Stack Overflow See other posts from Stack Overflow or by Liado
Published on 2010-05-20T10:30:50Z Indexed on 2010/05/20 10:40 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

Hi,

I have html validation using client side and server side validation.

The problem is when I open the page the validation text is visible before I fill in the text box and post the form. What can I do the solve this issue?

I'm using the following code:

<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript"></script>

<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) {%>

<%=Html.TextBox("Email", null, new { style = "width:190px;Border:0px", maxsize = 190 })%>

<%=Html.ValidationMessage("SingMeUp", "Invalid e-mail address.", new { @class = "Email_Validation_Error_Location_OverLoad", style = "float:left" })%>

© Stack Overflow or respective owner

Related posts about mvc

Related posts about client