Is it possible to get only the "Selected" text out of a TextBox

Discussion in 'ASP .Net Web Controls' started by Chris Bates, Jun 22, 2006.

  1. Chris Bates

    Chris Bates Guest

    Ok guys, here is what I am trying to do.

    Lets say I have a TexBox server control on a page.

    Lets say that TextBox has a bunch of text in it.

    Lets say that a user uses thier mouse to select a small part of the text
    then hits a button.

    I would like to be able on that button push to trap / get only the text the
    user has selected.

    Anyone have any ideas, I am coming up with nothing on google.

    Thanks

    Chris
     
    Chris Bates, Jun 22, 2006
    #1
    1. Advertising

  2. hi Chris,
    You are looking at writing some javascript to exclude the unselected text in
    your textbox when your submit button is clicked, that should populate the
    forms collection with the updated value in the textbox before the submit
    occurs.
    The following link might help you get started with the js you need to write.
    http://www.quirksmode.org/js/selected.html
    Good luck,
    Alessandro Zifiglio
    "Chris Bates" <> ha scritto nel
    messaggio news:...
    > Ok guys, here is what I am trying to do.
    >
    > Lets say I have a TexBox server control on a page.
    >
    > Lets say that TextBox has a bunch of text in it.
    >
    > Lets say that a user uses thier mouse to select a small part of the text
    > then hits a button.
    >
    > I would like to be able on that button push to trap / get only the text
    > the
    > user has selected.
    >
    > Anyone have any ideas, I am coming up with nothing on google.
    >
    > Thanks
    >
    > Chris
     
    Alessandro Zifiglio, Jun 23, 2006
    #2
    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. Replies:
    3
    Views:
    750
    George Ter-Saakov
    Feb 23, 2007
  2. clem
    Replies:
    1
    Views:
    719
  3. Kevin Quigley

    Getting the selected text from an asp textbox

    Kevin Quigley, Feb 13, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    175
    Alessandro Zifiglio
    Feb 13, 2004
  4. studen771
    Replies:
    3
    Views:
    119
    studen771
    Mar 31, 2005
  5. mariomueller
    Replies:
    2
    Views:
    554
    mariomueller
    Aug 24, 2006
Loading...

Share This Page