Input Form Field Javascript Events

Posted on Tuesday July 03, 2012 by Eric Potvin

Remember when we use to create custom functions for filtering data input in a web forms?

Well, now we don't have to. Some of them are very intuitive and avoid creating these functions we need to make sure the user won't cheat while filling out a form.

Here's few I personally like and are very useful:

  • oncopy
  • onpaste
  • oncut


<input type="text" name="field" oncopy="return false;" maxlength="32" onpaste="return false;" oncut="return false;" size="30" />


Easy no? Of course there's more and I won't here list all of them, but before start developing, remember to check if this is not already done for you!