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

The Archive Base Latest Questions

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

I know this issue has been touched on here but I have not found

  • 0

I know this issue has been touched on here but I have not found a viable solution for my situation yet, so I’d like to but the brain trust back to work and see what can be done.

I have a textarea in a form that needs to detect when something is pasted into it, and clean out any hidden HTML & quotation marks. The content of this form is getting emailed to a 3rd party system which is particularly bitchy, so sometimes even encoding it to the html entity characters isn’t going to be a safe bet.

I unfortunately cannot use something like FCKEditor, TinyMCE, etc, it’s gotta stay a regular textarea in this instance. I have attempted to dissect FCKEditor’s paste from word function but have not had luck tracking it down.

I am however able to use the jQuery library if need be, but haven’t found a jQuery plugin for this just yet.

I am specifically looking for information geared towards cleaning the information pasted in, not how to monitor the element for change of content.

Any constructive help would be greatly appreciated.

  • 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-11T22:16:44+00:00Added an answer on May 11, 2026 at 10:16 pm

    I am looking at David Archer’s answer and he pretty much answers it. I have used in the past a solution similar to his:

    $("textarea").change( function() {
        // convert any opening and closing braces to their HTML encoded equivalent.
        var strClean = $(this).val().replace(/</gi, '&lt;').replace(/>/gi, '&gt;');
    
        // Remove any double and single quotation marks.
        strClean = strClean.replace(/"/gi, '').replace(/'/gi, '');
    
        // put the data back in.
        $(this).val(strClean);
    });
    

    If you are looking for a way to completely REMOVE HTML tags

    $("textarea").change( function() {
        // Completely strips tags.  Taken from Prototype library.
        var strClean = $(this).val().replace(/<\/?[^>]+>/gi, '');
    
        // Remove any double and single quotation marks.
        strClean = strClean.replace(/"/gi, '').replace(/'/gi, '');
    
        // put the data back in.
        $(this).val(strClean);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this issue has been touched on before, e.g. here: How to post
I do not currently have this issue , but you never know, and thought
Update: This issue has been resolved. you can read about the solution in here:
I don't know if anyone has seen this issue before but I'm just stumped.
I know this isn't a unique issue but I've not had much luck finding
I know there is already a question about this but my issue is more
I know this isn't strictly a programming question but y'all must have experienced this.
I know this is not programming directly, but it's regarding a development workstation I'm
I know that the Hudson vs. CC issue has been beaten (discussed) to death,
I know this issue being mentioned before, but resolutions there didn't apply. I'm having

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.