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

  • SEARCH
  • Home
  • 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 7728171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:39:04+00:00 2026-06-01T05:39:04+00:00

Instead of showing an error message ‘Name is required’ I would like to change

  • 0

Instead of showing an error message ‘Name is required’ I would like to change (or also include) changing the background of the textbox to red (by the client side, the same way the error text is displayed). I imagine I have to use a javascript function.

Can anyone enligthen me please?

    <tr>
      <td>
         <asp:Label ID="lblName" runat="server" Text="Name" CssClass="bold" />
      </td>
      <td>
         <asp:TextBox ID="txtName" runat="server" TextMode="SingleLine" MaxLength="50" CssClass="textbox" />
      </td>
      <td>
         <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName" Display="Static" Text="Name is required!" Enabled="true" CssClass="validator" />
      </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-06-01T05:39:06+00:00Added an answer on June 1, 2026 at 5:39 am

    You can do it either by using jquery or by using a custom validator. Custom Validator might be a little easier and cleaner than jquery but both would accomplish the same thing.

    I found this blog post that might help you out: http://codinglifestyle.wordpress.com/2009/09/16/change-background-color-of-invalid-controls-asp-net-validator/

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

Sidebar

Related Questions

i would like to display the error message in the input element itself instead
I want to display script errors in a popup alert instead of showing them
I just want to see error insteas of asp.net showing me default error Server
Instead of showing the keyboard I want to display a popover view when a
What am I doing wrong that an exception is thrown instead of showing a
’ is showing on my page instead of ' . I have the Content-Type
edit: Now for some reason each productid is only showing up once instead of
Instead of using an interface like this: public interface IStartable { void Start(); void
I would like to have a function in my class that has a default
I get this error message when I try to authorize using my wp7 app

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.