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 3599376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:21:36+00:00 2026-05-18T20:21:36+00:00

I am using ASP.NET MVC 3 and FluentValidation for validating my view models. I

  • 0

I am using ASP.NET MVC 3 and FluentValidation for validating my view models.

I currently have my text boxes styled like this:

input[type="text"]{border:1px solid #c9d7e1;padding-left:2px;}

and I have a validator css class for if there is an error with the input:

.input-validation-error{border:1px solid #ff0000;background-color:#ffeeee;}

When validation kicks in then the background colour of the textbox is #ffeeee which is correct, but it does not make the border of the textbox red (#ff0000). It is still #c9d7e1. How do I change my styles so that it makes the border of the textbox red?

I also have my textareas defined as:

textarea{border:1px solid #c9d7e1;padding-left:2px;}

and the border gets set to red.

  • 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-18T20:21:37+00:00Added an answer on May 18, 2026 at 8:21 pm

    Because input[type="text"] is more specific than .input-validation-error so it takes priority.

    input[type="text"].input-validation-error{
        border:1px solid #ff0000;
        background-color:#ffeeee;
    }
    

    will do the job.

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

Sidebar

Related Questions

I am using ASP.NET MVC 3 and FluentValidation for validating my view models. I
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
Using ASP.NET MVC's default view engine, you can declare a server-side comment like this:
I have the following view in ASP.net MVC 3: @model Models.CreateProjectViewModel <script type=text/javascript src=@Url.Content(~/Scripts/jquery.validate.min.js)></script>
Using ASP.NET MVC & Spark, I have a view that is listing a number
'm using ASP.NET MVC 3 with Razor views. I have a partial view which
Using Asp.net MVC, I have one view that's strongly bind to List , and
Possible Duplicate: ASP.NET MVC - View with multiple models Using ASP.NET MVC 3.0, how
I am using ASP.Net MVC 3 Razor view engine. I have a requirement to
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />

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.