Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:30:37+00:00 2026-05-24T23:30:37+00:00

Hy, In my ASP.NET MVC application in the aspx page I set <% Html.EnableClientValidation();

  • 0

Hy,

In my ASP.NET MVC application in the aspx page I set

<% Html.EnableClientValidation(); %>

to enable client validation on my form. So, for my input I have this code to declare the texbox for email and it’s validation

<%: Html.TextBoxFor(model => model.Email)%>
<%: Html.ValidationMessageFor(model => model.Email)%>
<%: Html.ValidationSummary(true)%>

In the model I declare the email property like:

 [Required(ErrorMessage = "Required email")]
 [DisplayName("Email *")]
 [RegularExpression("^[a-z0-9+\\+-]+(\\.[a-z0-9+\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$", ErrorMessage = "Invalid email.")]
 public string Email { get; set; }

The question is, how can I get (using client script) the value of the error message when it’s displayed on the page?

So when I press some button I can see if the form is valid or not and after that I can display a loading gif.

Thanks a lot.

Jeff

Update

HTML source code:

<tr>
   <td class="editor-field">
      <input id="Email" name="Email" type="text" value="" />
   </td>
</tr>
<tr>
   <td class="editor-field-validation">
     <span class="field-validation-valid" id="Email_validationMessage"></span>
     <div class="validation-summary-valid" id="validationSummary"><ul><li style="display:none"></li>
</ul></div> 
   </td>
</tr>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:30:37+00:00Added an answer on May 24, 2026 at 11:30 pm

    The value of error message (text) will probably displayed in div or span. Simply check what will be the id of that field (for example with FireBug). And then you will be able to get the value of that when you’ll need it.

    Because I understand that you are calling validation manualy in JavaScript, yes?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple ASP.NET MVC application, like movie sample. In the list.aspx page
I've accidentaly clicked Set as Startup page on Index.aspx of ASP.NET MVC application. Now
I am using FckEditor in Create.aspx page in asp.net mvc application. Since I need
I'm building an ASP.NET MVC application with a form that needs validation. The majority
My web application is an Asp.Net MVC pattern. None of the .aspx pages have
I created an ASP.NET MVC application and added 2 resource file for about.aspx page
I have created an asp.net MVC application.I created a asp:menu in the master page
If i have an ASP.NET MVC 2 Web Application with the following Views: Main.aspx
I have a Web Forms page in my ASP.NET MVC application. I need to
I'm using the spark view engine with my asp.net mvc application. In my aspx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.