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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:13:09+00:00 2026-06-14T15:13:09+00:00

I am having a problem with some code. I have looked across the web

  • 0

I am having a problem with some code. I have looked across the web and at stackoverflow and i cannot see what else i can do to resolve the problem for classic asp.

The issue is that i am trying to remove the case return and line feed from being entered into the XML string however i have encounter a flaw in my code but unsure how to stop this from happening.

function DisableEnter()
{
    if (window.event.keyCode == 13) 
        {
        event.returnValue=false; 
        event.cancel = true;
        }
}

This stops the user from entering the “return” key which is great BUT what happens when you copy and paste the text that has enters in them? In my case it bypasses this check and inputs this into the database.

Server.URLEncode(Replace(Replace(Replace(other_info,","," "),"\n",""),"\r",""))

I have entered this replace to try to resolve the \n\r that i noticed in a lot of posts is the symbols for the carriage return and line feed but it still submits?

<td><textarea name="other_info" cols="30" rows="5" id="other_info" onkeypress="DisableEnter()" onkeyup="DisableEnter()"><%=Request("other_info")%></textarea></td>

Therefore basically the question is how do i eliminate new line/carriage return/line feed from being entered into my database that has been copy and pasted therefore when our process of exporting the data to a CSV spreadsheet for another application to read it which must be on 1 line in the cell.

If you require any other information please let me know.

Thanks for your time.

  • 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-14T15:13:10+00:00Added an answer on June 14, 2026 at 3:13 pm

    HI here is an example with javascript.

    the code is ready to be copy pasted and tested

    <html>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
        <style>
    
        </style>
    </head>
    <body>
        <div id="container">
        <textarea id="data" cols="30" rows="5"></textarea>
        <button id="submit">submit</button>
        <textarea id="output" cols="30" rows="5"></textarea>
        </div>
    </body>
    <script>
        $(document).ready( function (){
            $('#submit').click(function(event){
                var txt = $('#data').val();
                var newstr = txt.replace(/\s/g, '');
                $('#output').val(newstr);
            });
        });
    
    </script>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem with some code I've written. I've had to anonymize it,
I'm having a problem with some code that used to work in PHP 4.X
I've having this problem with some JavaScript code. I've simplified it in the error
The following code is having some problem with the jQuery. <script type="text/javascript"> $(window).load(function() {
I am having some problem with jsonp and jquery. This is my code -
I'm building a website and having some problem. if the HTML code is like:
I am currently trying to test some code I have in a web application
I have some OAM code here, and I've looked up all the instructions, what
I'm having problems with some code to create a CDialog based window. The code
I'm having some problems trying to get the code below to output the data

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.