title: Prevent copy/paste and right-click meant for textbox (email address)
body: <p>I would like to prevent a user from either:</p>
  
  <ol>
  <li>Copy and pasting from the first textbox to the second</li>
  <li>Right-click and use the context menu to copy and paste from the first textbox to the second.</li>
  </ol>
  
  <p>This is not working.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;head runat="server"&gt;
      &lt;title&gt;Confirm email page&lt;/title&gt;
      &lt;script  type="text/javascript" language="javascript"&gt;
      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;
          }
      }
      &lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body style="font-family: Verdana; font-size: 1em"&gt;
      &lt;form id="form1" runat="server"&gt;
        &lt;div&gt;
          &lt;h1&gt;Confirm Email&lt;/h1&gt;
          &lt;asp:Label ID="Label2" runat="server" Text="Enter Email Address: "&gt;&lt;/asp:Label&gt;
          &lt;asp:TextBox ID="TextBox2" runat="server" oncopy="return false" onMouseDown="DisableRightClick(event)" &gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
          &lt;asp:Label ID="Label3" runat="server" Text="Confirm Email Address: "&gt;&lt;/asp:Label&gt;
          &lt;asp:TextBox ID="TextBox3" runat="server" onKeyDown="return DisableCtrlKey(event)"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>GOT IT WORKING!!!!</strong></p>
  
  <pre><code>&lt;div&gt;
  &lt;h1&gt;Copy Paste Preventer!!!&lt;/h1&gt;
      &lt;asp:Label ID="Label1" runat="server" Text="Enter Username: "&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
      &lt;asp:Label ID="Label2" runat="server" Text="Enter Email Address: "&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="email" runat="server"  oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
      &lt;asp:Label ID="Label3" runat="server" Text="Confirm Email Address: "&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox3" runat="server" oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="forms[0].elements[0].value++; return false"&gt; &lt;/asp:TextBox&gt;&lt;br /&gt;
  &lt;/div&gt;
  </code></pre>