javascript - Disable Copy or Paste action for text box? -
i have 2 textboxes, , want prevent user copying value first (email) textbox , pasting in second (confirmemail) textbox.
email: <input type="textbox" id="email"><br/> confirm email: <input type="textbox" id="confirmemail">
i have 2 solution in mind:
- prevent copy action email textbox, or
- prevent paste action confirmemail textbox.
any idea how it?
check fiddle fiddle
$('#email').bind("cut copy paste",function(e) { e.preventdefault(); });
you need bind should done on cut,copy paste.you prevent default behavior of action. can find detailed explanation here
Comments
Post a Comment