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

The Archive Base Latest Questions

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

I have a problem with Javascript and HTML. I’m using a form that the

  • 0

I have a problem with Javascript and HTML.
I’m using a form that the user submits. If the credentials are wrong, the script shows a text message next to the input field.
The message contains an email which I want it to be clickable.
The things is that:
When the message is only a string, everything is OK.
When I add the <a href=\"mailto tag, the line breaks.

<div id="message_box">
<span id="msgbox" style="display:none"></span>
</div>

OK:

$("#msgbox").fadeTo(200,0.1,function()
        {
            var msg = ("Ooops, the number you enterd is not valid<br /> Please contact: some@mail.com to solve this problem").replace(/[\r\n]/g, '');
          $(this).html(msg).addClass('messageboxerror').fadeTo(900,1);
        }); 

(EDIT)Shows:
Ooops, the number you enterd is not valid
Please contact: some@mail.com to solve this problem
lines ok, the email is not clicakble

NOT OK:

$("#msgbox").fadeTo(200,0.1,function()
        {
            var msg = ("Ooops, the number you enterd is not valid<br /> Please contact: <a href=\"mailto:some@mail.com\">some@mail.com</a> to solve this problem").replace(/[\r\n]/g, '');
          $(this).html(msg).addClass('messageboxerror').fadeTo(900,1);
        }); 

(EDIT)Shows:
Ooops, the number you enterd is not valid
Please contact:
some@mail.com
to solve this problem
lines broken, email clickable

The CSS:

#message_box {
    width:370px;
    height:30px;
    padding-top:15px;
}



   .messagebox{
 position:relative;
 width:100px;
 margin-left:0px;
 padding:290px;
 font-size:14px;
 color: #647a03;
}
.messageboxok{
 position:relative;
 padding:0px;
 width:100px;
 color:#F00;
 font-size:10px;

}
.messageboxerror{
 position:relative;
 width:100px;
 padding:0px;
 color:#CC0000;
 font-size:12px;
}

Can anyone help me remove these annoying linebreaks??

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-23T22:27:45+00:00Added an answer on May 23, 2026 at 10:27 pm

    From comments:

    Given the complete CSS code requested by several commenters, the a tag is set to display: block. It needs to be set to inline for this anchor tag.

    W3C Resources:

    • Controlling box generation
    • The ‘display’ property
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem when using javascript in Firefox, here is the html: <HTML>
I have problem in some JavaScript that I am writing where the Switch statement
I have a problem with a javascript set of functions that I made. This
i have an unusual javascript problem, i have a javascript problem that alternately refuses
Using Crockford's method ( http://javascript.crockford.com/prototypal.html ) doesn't work when we have reference values in
I have a problem with the following HTML: <a href=javascript:document.formName.submit(); target=iframe> Where formName is
I have a problem with javascript indenting in vim. Everything works great, except that
I have HTML table in which user make GRUD operations. But everyone knows that
I have a problem creating a for-loop using Javascript. It seems everyting is fine
<html> <head> <script type=text/javascript src=jquery.js></script> <script type=text/javascript> $(document).ready(function(){ $(.region).load('getRecords.php?start=regions'); }); </script> </head> <body> <select>

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.