<p>I've noticed that some sites (usually banks) suppress the ability to paste text into text fields. How is this done? I know that JavaScript can be used to swallow the keyboard shortcut for paste, but what about the right-click menu item?</p>

[{'answer_id': 33130, 'author': 'bdukes', 'author_id': 2688, 'author_profile': 'https://Stackoverflow.com/users/2688', 'pm_score': 4, 'selected': True, 'text': '<p>Probably using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.onpaste" rel="nofollow noreferrer"><code>onpaste</code></a> event, and either <code>return false</code> from it or use <code>e.preventDefault()</code> on the Event object.</p>\n\n<p>Note that <code>onpaste</code> is <em>non standard</em>, don\'t rely on it for production sites, because it will not be there forever.</p>\n\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).on("paste",function(e){\r\n  console.log("paste")\r\n  e.preventDefault()\r\n  return false;\r\n})</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 37108, 'author': 'LucaM', 'author_id': 3511, 'author_profile': 'https://Stackoverflow.com/users/3511', 'pm_score': 2, 'selected': False, 'text': '<p>Even if it is somewhat possible to intercept the paste event in many browsers (but not all as shown at the link on the previous answer), that is quite unreliable and posible not complete (depending on the browser / OS it may be possible to do the paste operation in different ways that may not be trappable by javascript code).</p>\n\n<p><a href="http://discerning.com/topics/software/ttw.html#copy_and_paste" rel="nofollow noreferrer" title="Here">Here</a> is a collection of notes regarding paste (and copy) in the context of rich text editors that may be applied also elsewhere.</p>\n'}]
['https://Stackoverflow.com/questions/33103', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1450/']