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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:02:37+00:00 2026-06-01T08:02:37+00:00

When we copy some text separated by new line and try to paste it

  • 0

When we copy some text separated by new line and try to paste it in a text field in IE, the text gets truncated starting from the first new line character. In Firefox and Chrome, the new line character simply converts to a space. I am required to implement a uniform behaviour for all of these browsers.

If I can get hold of the copied text, I can convert all \r\n to \n and then all \n to the space character, but I can’t think of a way to access the copied text before its truncated

  • 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-01T08:02:38+00:00Added an answer on June 1, 2026 at 8:02 am

    For IE only!! You can get the information from window.clipboardData as shown here:

    $('input:text').on('paste', function(ev) {
        var multiCellTarget = $(this);
        setTimeout(function() {
            var cells = window.clipboardData.getData('text').split(/\s+/);
            if (cells.length > 1) {
                // [... do stuff with cells]
            }
        }, 20);
    });
    

    The 20 ms timeout is a trick to work around the problem that the clipboard data does not seem to be available at the time jquery kicks off the paste event.

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

Sidebar

Related Questions

When I open Vim from a terminal, copy some text to the system clipboard,
I'm doing the following to copy some text inside quotes and paste it in
Possible Duplicate: Copy to clipboard without Flash I want to copy some text from
I want to copy some functions from OpenCV library to my embedded application. Rewriting
How do I copy some directory from one place to another (not file by
Let's say I copy some files with ant, from a network drive: <copy todir=.
I was asked to implement a code to copy some info from a Oracle
i have problem with cut some text from UITextView , i idon't understand how
Im trying to make some text non-copyable, my aim isn't to stop people from
I want to copy some text files, that are written by another app, but

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.