how to make impossible to select content of textbox?

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
 
G

Guest

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
 
L

Luc

Thanks

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
 
Last edited by a moderator:
G

Guest

Thanks

"Anon User" <[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
 
L

Luc

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





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
 
Last edited by a moderator:
G

Guest

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

"Anon User" <[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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top