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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:14:05+00:00 2026-06-18T23:14:05+00:00

I have validation summary that sometimes has multiple br tags at the end like

  • 0

I have validation summary that sometimes has multiple br tags at the end like below:

<div id="ValidationSummary1" class="alert alert-error">
    Last 4-digits of Social Security number does not match 
    the Member record on file for the Member ID number you 
    have entered.<br />
    Date of Birth does not match the Member record on file for the Member ID 
    number you have entered.<br /><br />
</div>

I’m trying to find anytime there are two br tags back to back and replace it with one like below:

$('#ValidationSummary1').replace('<br /><br />', '<br />');

I understand there isn’t a replace() function. What would be the alternative to something simple like this?

  • 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-18T23:14:06+00:00Added an answer on June 18, 2026 at 11:14 pm

    Use .html() to get and set the content passing it through the standard JS replace().

    var div = $('#ValidationSummary1');
    div.html(div.html().replace('<br /><br />', '<br />'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following validation summary control in the markup: <asp:ValidationSummary ID=vsValErrs CssClass=errors HeaderText=<div><%#
I have a form that i want to validate ( show validation summary, show
By default Html.ValidationSummary() produces HTML like this: <span class=validation-summary-errors>There were some errors...</span> <ul class=validation-summary-errors>
I have a parent class implementing INotifyPropertyChanged, and the parent class has multiple children.
Using asp.net validators, I'd like a control similar to the validation summary, except that
how to append error messages on validation summary through javascript. i have added a
I have two validation groups: parent and child I have an add button that
We have a rule that all of our validation messages must be in a
We have a ASP.NET MVC 3 application that uses unobtrusive jQuery validation. The page
I have a form that I would like to endow with wonderful Ajax-submission goodness

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.