how to make impossible to select content of textbox?

Discussion in 'ASP .Net' started by Luc, Mar 1, 2010.

  1. Luc

    Luc 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
     
    Luc, Mar 1, 2010
    #1
    1. Advertising

  2. On Mar 1, 10:59 pm, "Luc" <> wrote:
    > 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
     
    Alexey Smirnov, Mar 1, 2010
    #2
    1. Advertising

  3. Luc

    Luc Guest

    Thanks

    "Alexey Smirnov" <> schreef in bericht
    news:...
    On Mar 1, 10:59 pm, "Luc" <> wrote:
    > 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
     
    Luc, Mar 2, 2010
    #3
  4. On Mar 2, 3:15 pm, "Luc" <dfgdf@sdfsd> wrote:
    > Thanks
    >
    > "Alexey Smirnov" <> schreef in berichtnews:...
    > On Mar 1, 10:59 pm, "Luc" <> wrote:
    >
    > > 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


    I'm glad that it's helped you out. I just noticed that oncopy and
    onpaste are not working in Opera
     
    Alexey Smirnov, Mar 2, 2010
    #4
  5. Luc

    Luc 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




    "Alexey Smirnov" <> schreef in bericht
    news:...
    On Mar 2, 3:15 pm, "Luc" <dfgdf@sdfsd> wrote:
    > Thanks
    >
    > "Alexey Smirnov" <> schreef in
    > berichtnews:...
    > On Mar 1, 10:59 pm, "Luc" <> wrote:
    >
    > > 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


    I'm glad that it's helped you out. I just noticed that oncopy and
    onpaste are not working in Opera
     
    Luc, Mar 3, 2010
    #5
  6. On Mar 3, 3:16 pm, "Luc" <dfgdf@sdfsd> wrote:
    > 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" <> schreef in berichtnews:...
    > On Mar 2, 3:15 pm, "Luc" <dfgdf@sdfsd> wrote:
    >
    >
    >
    >
    >
    > > Thanks

    >
    > > "Alexey Smirnov" <> schreef in
    > > berichtnews:...
    > > On Mar 1, 10:59 pm, "Luc" <> wrote:

    >
    > > > 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

    >
    >  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.
     
    Alexey Smirnov, Mar 3, 2010
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hazz
    Replies:
    6
    Views:
    49,771
    SkyUCHC
    Jun 9, 2010
  2. =?Utf-8?B?V29tYmxldWs=?=

    File select dialog - Impossible?

    =?Utf-8?B?V29tYmxldWs=?=, Feb 9, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    397
    =?Utf-8?B?V29tYmxldWs=?=
    Feb 9, 2007
  3. PJ6
    Replies:
    1
    Views:
    321
  4. palmiere
    Replies:
    1
    Views:
    431
    Erwin Moller
    Feb 9, 2004
  5. Replies:
    5
    Views:
    273
    Michele Dondi
    Jun 30, 2006
Loading...

Share This Page