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

  • Home
  • SEARCH
  • 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 7656165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:41:54+00:00 2026-05-31T12:41:54+00:00

I would like to prevent a user from either: Copy and pasting from the

  • 0

I would like to prevent a user from either:

  1. Copy and pasting from the first textbox to the second
  2. Right-click and use the context menu to copy and paste from the first textbox to the second.

This is not working.

<html>
  <head runat="server">
    <title>Confirm email page</title>
    <script  type="text/javascript" language="javascript">
    function DisableRightClick(event) {
        //For mouse right click 
        if (event.button == 2) {

        }
    }
    function DisableCtrlKey(e) {
        var code = (document.all) ? event.keyCode : e.which;
        // look for CTRL key press
        if (parseInt(code) == 17) {
            window.event.returnValue = false;
        }
    }
    </script>

  </head>
  <body style="font-family: Verdana; font-size: 1em">
    <form id="form1" runat="server">
      <div>
        <h1>Confirm Email</h1>
        <asp:Label ID="Label2" runat="server" Text="Enter Email Address: "></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" oncopy="return false" onMouseDown="DisableRightClick(event)" ></asp:TextBox><br />
        <asp:Label ID="Label3" runat="server" Text="Confirm Email Address: "></asp:Label>
        <asp:TextBox ID="TextBox3" runat="server" onKeyDown="return DisableCtrlKey(event)"></asp:TextBox><br />
      </div>
    </form>
  </body>
</html>

GOT IT WORKING!!!!

<div>
<h1>Copy Paste Preventer!!!</h1>
    <asp:Label ID="Label1" runat="server" Text="Enter Username: "></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
    <asp:Label ID="Label2" runat="server" Text="Enter Email Address: "></asp:Label>
    <asp:TextBox ID="email" runat="server"  oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"></asp:TextBox><br />
    <asp:Label ID="Label3" runat="server" Text="Confirm Email Address: "></asp:Label>
    <asp:TextBox ID="TextBox3" runat="server" oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"> </asp:TextBox><br />
</div>
  • 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-31T12:41:55+00:00Added an answer on May 31, 2026 at 12:41 pm
    <div>
    <h1>Copy Paste Preventer!!!</h1>
        <asp:Label ID="Label1" runat="server" Text="Enter Username: "></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
        <asp:Label ID="Label2" runat="server" Text="Enter Email Address: "></asp:Label>
        <asp:TextBox ID="email" runat="server"  oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"></asp:TextBox><br />
        <asp:Label ID="Label3" runat="server" Text="Confirm Email Address: "></asp:Label>
        <asp:TextBox ID="TextBox3" runat="server" oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"> </asp:TextBox><br />
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how to prevent the user from entering data into
I would like to prevent the user from clicking on saturdays/sundays (week-ends) when he
I would like to prevent copy, cut and paste in my TEdit . How
I would like to prevent a property from being exposed via my WCF web
I would like to either prevent or handle a StackOverflowException that I am getting
Here's an example of the sort of query I would like to prevent from
I have an ActiveRecord object and I would like to prevent it from being
I would like to prevent my program from dropping the database each time I
I'd like to warn or prevent a user from deleting an object instance which
I would like to prevent duplicate content. I do not want to keep a

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.