Skip to content

Instantly share code, notes, and snippets.

@vagnerzampieri
Last active December 25, 2015 12:59
Show Gist options
  • Select an option

  • Save vagnerzampieri/6979979 to your computer and use it in GitHub Desktop.

Select an option

Save vagnerzampieri/6979979 to your computer and use it in GitHub Desktop.
Disable Ctrl+c and Ctrl+v with JQuery
$(document).ready(function(){
function bindingElements(element, index, array) {
$(element).bind("copy paste", function(e){
e.preventDefault();
});
};
['#user_confirm_email', '#user_password_confirmation'].forEach(bindingElements);
});
$(document).ready(function(){
$('#user_confirm_email').bind("copy paste", function(e){
e.preventDefault();
});
});
= simple_form_for @user do |f|
= f.input :email
= f.input :confirm_email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment