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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:36:48+00:00 2026-06-14T05:36:48+00:00

When I paste the following into the text area, when onblur it’s supposed to

  • 0

When I paste the following into the text area, when onblur it’s supposed to tidy up the text pasted removing certain words, tab spaces and tidying up by placing each value separated by the tabs spaces into it’s own line. But it always leaves a blank empty line at the very first line:

Note: I can’t seem to emulate tab spaces in html so you’ll have to manually type the following in notepad to properly replicate my problem: where %%% replace with tab space in notepad then select-all and copy/paste into my js fiddle example textarea

  Customer account %%% Name %%% Telephone   %%%  Street name %%% City %%% postcode%%% 1234LA3 %%% KCI ASDFGHJ %%% 1234567890 %%% 10 EXAMPLE ST %%% EXAMPLE CITY %%% 1234    

when you onblur
It ends up looking like this:


1234LA3 
KCI ASDFGHJ 
1234567890 
10 EXAMPLE ST 
EXAMPLE CITY 
1234

notice blank empty space above ‘1234LA3’.

I’ve already tried adding \n\r in my .replace() method but still doesn’t seem to filter out this empty line.

any kind of help will be greatly appreciated. thank you!

  • 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-14T05:36:49+00:00Added an answer on June 14, 2026 at 5:36 am
    value=value.replace(/^(\r\n)|(\n)/,'');
    

    Seems to do the trick.

    DEMO

    Also, you can emulate tab characters in html with 	, not to mention that you don’t need to prefix javascript in events with javascript:.

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

Sidebar

Related Questions

When I paste the following text into IRB or PRY running under ruby-enterprise-2011.03, it
it works perfectly fine if I paste the following URL directly into my IE
If you copy and paste the following text in a html page, انوان you
I want to display the following text in my program.When ever I paste the
If you paste the following code into a test.html and browse with firefox,it's ok.
I have to paste the data in HTML input text fields in the following
If you paste the following into the url bar in chrome and try to
When you paste the following URL into IE: http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx , the link on the
so I pasted following into my .htaccess (www.storyfollower.com): #Gzip # compress the files AddOutputFilterByType
I noticed that if you copy-paste web browser content into Notepad (or any text

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.