Determine user-selected text
I would like to provide users with a text box in which they can enter a
bunch of text (200 bytes or so). I would like to subsequently
programmatically determine which text the user has selected.
How can the user selection (selected text) be determined during a postback?
How about on the client side? Can it be determined without having to first
post back? I need to understand both ways.
RE: Determine user-selected text
If you need to send the text to the server for processing, you can do the following.
From the client side, you can insert any text into a hidden serverside text control (TextBox1) with document.all.TextBox1.value = "some selected string". On the serverside, check for Page.IsPostBack == true and get the value from TextBox1.Text.
Hope this helps,
DISCLAIMER: This posting is provided "AS IS" with no warranties, and confers no rights.
|All times are GMT. The time now is 05:46 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.