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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:19:36+00:00 2026-05-17T06:19:36+00:00

I have a custom error script that displays custom error messages on a page

  • 0

I have a custom error script that displays custom error messages on a page if a user tries to submit a form and it fails validation.

On the focusout of the input element (the input that failed validation) I am trying to remove the DOM element I added, but its removing all of the DOM elements with the class name I specify that exist on the page.

Adding the DOM element:

$('#' + el).closest('tr').addClass('pink_bg');
var error_txt = $('#' + el).attr('rel');
$('#' + el).before('<span class="registration_error_message">' + error_txt + '</span>');

Attempting to remove the DOM element (this removes all of the DOM elements of class=”registration_error_message”), all I want to do is remove one of the elements:

$("#" + el).focusout(function(){
    $(this).parent().remove('[class^=registration_error_message]');
    $(this).closest('tr').removeClass('pink_bg red_border');
});
  • 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-17T06:19:37+00:00Added an answer on May 17, 2026 at 6:19 am

    Since you’re adding the .registration_error_message element before the el element using jQuery’s .before() method, it would seem that you want to use .prev() instead of using .parent() when removing.

    $(this).prev().remove('[class^=registration_error_message]');
    

    Or

    $(this).prev('[class^=registration_error_message]').remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have fully working validation script my problem is that i can't get custom
Given that I have a custom PHP error handler already, does it make sense
I have the following script that I run as a custom build step in
I have a Unix bash function that executes a script that parses custom environment
Basically I have a page named dvds.asp with a form that goes to action=process.asp
I have created a custom PHP script which uploads information submitted by a form
I have a custom jQuery script that works fine in all bowsers but one
I have a custom validation function in JavaScript in a user control on a
I have a form with jquery validation. I have some custom rules, but they
I have a custom error pages in my rails app testing the 404 error

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.