how to make impossible to select content of textbox?

  • Thread starter Thread starter Luc
  • Start date Start date
L

Luc

Hi,

i need two textboxes, one for entering and another for confirming an
emailaddress.

What i want is to make impossible to select the emailaddress in the first
textbox in order not to be able to copy it in the second textbox.

I'm sure it's possible to do that asp.net (ajax?), but how?
Thanks
Luc
 
Hi,

i need two textboxes, one for entering and another for confirming an
emailaddress.

What i want is to make impossible to select the emailaddress in the first
textbox in order not to be able to copy it in the second textbox.

I'm sure it's possible to do that asp.net (ajax?), but how?
Thanks
Luc

Hi Luc

try

<asp:TextBox ID="TextBox1" runat="server"
oncopy="return false"
onpaste="return false"
oncut="return false"></asp:TextBox>

Hope this help
 
Thanks

"Alexey Smirnov" <[email protected]> schreef in bericht
Hi,

i need two textboxes, one for entering and another for confirming an
emailaddress.

What i want is to make impossible to select the emailaddress in the first
textbox in order not to be able to copy it in the second textbox.

I'm sure it's possible to do that asp.net (ajax?), but how?
Thanks
Luc

Hi Luc

try

<asp:TextBox ID="TextBox1" runat="server"
oncopy="return false"
onpaste="return false"
oncut="return false"></asp:TextBox>

Hope this help
 
Thanks

"Alexey Smirnov" <[email protected]> schreef in bericht




Hi Luc

try

<asp:TextBox ID="TextBox1" runat="server"
oncopy="return false"
onpaste="return false"
oncut="return false"></asp:TextBox>

Hope this help

I'm glad that it's helped you out. I just noticed that oncopy and
onpaste are not working in Opera
 
Maybe one more question:

I use Visual Web Developer but when i go to the properties of Textbox in the
aspx file, i only see OnLoad, OnUnload and some others, but no oncopy,
oncut, onpaste.
Are those functions asp.net functions or javascript? If javascript, where
can i see the whole list of such functions?

Thanks




"Alexey Smirnov" <[email protected]> schreef in bericht
Thanks

"Alexey Smirnov" <[email protected]> schreef in
bericht




Hi Luc

try

<asp:TextBox ID="TextBox1" runat="server"
oncopy="return false"
onpaste="return false"
oncut="return false"></asp:TextBox>

Hope this help

I'm glad that it's helped you out. I just noticed that oncopy and
onpaste are not working in Opera
 
Maybe one more question:

I use Visual Web Developer but when i go to the properties of Textbox in the
aspx file, i only see OnLoad, OnUnload and some others, but no oncopy,
oncut, onpaste.
Are those functions asp.net functions or javascript? If javascript, where
can i see the whole list of such functions?

Thanks

"Alexey Smirnov" <[email protected]> schreef in bericht




 I'm glad that it's helped you out. I just noticed that oncopy and
onpaste are not working in Opera- Hide quoted text -

- Show quoted text -

Those are DHTML events. That's the reason why you don't see them.
Because ASP.NET doesn't "know" them, they will be rendered to the
client "as is".

You can find more events here http://msdn.microsoft.com/en-us/library/ms533051.aspx

Hope this helps.
 
Back
Top