Monday, May 31, 2010

Disable copy and paste into form text field

People sometimes got lazy just to enter information such thing like this below :

your email :
confirm your email :

the second question to confirm your email address, or to be exact, to retype again the email address is having a purpose to minimize the typo or any other problem like incorrect email address, or by mistake, entering another person email address.

but because of laziness, many times for second question, people just do copy and paste, ctrl-c and ctrl-v to that column, so at this point, the purpose of having second question is no longer valid anymore.

to prevent such behaviour, here is simple trick on the HTML form.

<input type="text" class="medium" name="contactEmail2" id="contactEmail2" onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false" tabindex="23"/>


with that addition, people are no longer able to do paste/ctrl-v into it.

No comments:

current

last archive