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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:40:43+00:00 2026-05-23T16:40:43+00:00

I am using javascript form validation, and jquery to display the error messaging and

  • 0

I am using javascript form validation, and jquery to display the error messaging and to highlight the fields.

The current behavior is when you click submit, the validation runs returning an error message, and when a user clicks back into the field the error message disappears but the form highlighting (a red border around the field) remains – until the user submits the form again.

Additional behavior that’s needed (working in firefox but not in IE) is when an error state pops up, the field returning the error is supposed to lose focus, and the user has to click back into the field (which then removes the error message). In IE, the focus is never removed.

<script language="JavaScript" type="text/javascript">
<!--Jquery function to override JS alert with DOM layer alert message-->
function customAlert(){
    var args = arguments;
    if(args.length > 1) {
        // check that custom alert was called with at least two arguments
        var msg = args[0];
        $("li").removeClass("alertRed");
        $("input").removeClass("CO_form_alert");
        $("select").removeClass("CO_form_alert");
        var div = $(".errorPopup");
        div.css({"display":"block"});
        if (div.length == 0) {
            div = $("<div class='errorPopup' onclick='$(this).hide();'></div>");
            $("body").prepend(div);
        }
        div.html(msg);
        for(var i = 1; i < args.length; i++) {
            var inputID = args[i];
           $("#"+inputID).addClass("CO_form_alert").parent().addClass("alertRed");
            $("#"+inputID).focus(function(){
                $(this).unbind('focus'); // remove this handler
                $('.errorPopup').hide(); // hide error popup
            });
        }
     }
}

</script>
  • 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-23T16:40:44+00:00Added an answer on May 23, 2026 at 4:40 pm

    rather than unbind('focus') you could try blur()

    EDIT:

    Blur Event Does not get Fired in IE7 and IE6

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

Sidebar

Related Questions

I'm using jQuery with PHP for form validation. I want to return the fields
using javascript validation and some jquery to show variable error messages in the DOM,
I'm using the current version of ASP.net MVC to display a form. Validation is
I am done with validation using javascript for a form in PHP. When is
How do you detect which form input has focus using JavaScript or jQuery? From
I'm using a javascript function to submit my form. This works in every browser
I am using html, javascript & mod_python. I want to submit html form. To
I have a simple html form that I've added validation to using the JQuery
I am using the jQuery validation plugin on my form. I set the basic
I am doing form submission and validation using jQuery and from server side I

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.