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:

  1. prevent copy action email textbox, or
  2. prevent paste action confirmemail textbox.

any idea how it?

http://jsfiddle.net/s22ew/

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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -