Posts Tagged ‘disable’

Validator Enable/Disable in using Javascript

February 3, 2010 Leave a comment

You can enable/disable validators using javascript as follows:

ValidatorEnable(document.getElementById(‘<%= rfv.ClientID %>’), false);

First argument is id of validator, second argument is to enable pass “true”, else pass “false”.


Disable Copy/Paste in textbox

May 23, 2009 2 comments

Sometimes you don’t want to allow user to copy/paste or (Ctrl + C)/(Ctrl + V) in textbox.

You have to use onCopy=”return false” onPaste=”return false”

Here is an example of that:

<asp:TextBox ID=”tb_Email”  runat=”server”
onCopy=”return false” onPaste=”return false” ></asp:TextBox>

This will restrict user from directly copy/paste into textbox, they have to type manually.