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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:38:32+00:00 2026-05-14T03:38:32+00:00

Okay guys, I have read through all the other posts and question on jQuery

  • 0

Okay guys,

I have read through all the other posts and question on jQuery Validation plugin and they don’t seem to have what I’m looking to do.

I would like to have the display error not show with message but just create a red border around the input field instead.

Here is just some of the form:

<form id="donate_form" name="checkoutForm" method="post">
    <label class="desc" id="title0" for="billing_name_first">
    Name
    <span id="req_1" class="req">*</span>
</label>
<div>
    <span class="left">
        <input name="billing.name.first" id="billing_name_first" type="text" class="field text required" value="" tabindex="1" />
        <label for="billing_name_first">First</label>
    </span>
    <span class="right">
        <input name="billing.name.last" id="billing_name_last" type="text" class="field text required" value="" tabindex="2" />
        <label for="billing_name_last">Last</label>
    </span>
</div>

I am assuming that I need to place the class required on the input??

Then with CSS hide the label.error which is spit out by the plugin? I’ve tried that but no go.

Am I looking in the right place?

Thanks!

  • 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-14T03:38:32+00:00Added an answer on May 14, 2026 at 3:38 am

    I understand what you are trying to achieve; I had the same requirements but had serious difficulties trying to achieve it, but I did. Here’s how:

    1. I created two CSS style classes “errorHighlight” and “textinput”, like so:

      .errorHighlight { border: 2px solid #CC0000; }
      .textinput {border: 1px silver solid;}

    2. At design time, I applied the “textinput” class to my text input fields: <input type="text" class="textinput" />

    3. And then in my jQuery form validation plugin settings inside my Javascript file, I added the following general validation settings for all forms on this page:

              $.validator.setDefaults({
                  errorPlacement: function(error, element) {  
                      $(element).attr({"title": error.text()});
                  },
                  highlight: function(element){
                      //$(element).css({"border": "2px solid #CC0000"});
                      $(element).removeClass("textinput");
                      $(element).addClass("errorHighlight");
                  },
                  unhighlight: function(element){
                      //$(element).css({"border": "2px solid #CC0000"});
                      $(element).removeClass("errorHighlight");
                      $(element).addClass("textinput");
                  }
              });
      

    Now, whenever a field fails validation, the “highlight” callback function is called on the element. The “errorPlacement” callback function prevents the default action of inserting a label after the erring input field, instead it appends the error message to the “title” attribute of the field (which can be used as the source of text for a tooltip display).

    Hope this helps.

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

Sidebar

Related Questions

Hey guys. I have some difficulty in creating a filename. okay, here is what
Sorry guys, it's another CSS height 100% (sortof) question... I have a layout like
Possible Duplicate: How Turn on only Camera flash light programmatically in android? okay guys,
REVISED: Okay, thanks to all of your input, I figured out what I was
Hey guys, first off I played around with shortcodes, but they aren't working. I
Hey guys! I have some problems reloading my tableView. I have subclasses my tableView,
Okay, I have two different background .jpgs that I want to used as the
EDIT 2 Okay, I've posted a copy of my source at gist.github and I
I have two projects in one solution : Class Library for my BLL and
I'm reading in a text file using BinaryReader, then doing what I want with

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.