Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #9780
| From | Norman Peelman <npeelmandog@cfl.rr.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Input Controls |
| Date | 2011-12-30 06:40 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <jdk7vm$inq$1@dont-email.me> (permalink) |
| References | <sk5qf7h79vi3f5v6u1rnapq4t5e5020h8d@4ax.com> |
On 12/29/2011 09:11 PM, Gene Wirchenko wrote: > Dear JavaScripters: > > I have some fine points that I would like to know how to do in > JavaScript. I do not know that they are even possible. Having them > would make data entry much easier. > > 1) Position to a particular point in a control's value. For > example, if entering a date, it could be much more user-friendly if, > when the control gets focus, the cursor were positioned just before > the days as in: > 201112@29 > where the at-sign represents the cursor. (In my app-to-be, the date > is usually in the current month, but not always.) > > 2) I want to be able to programmatically select part of an input > control value. e.g. Click on some part of the sentence below and > have that word and only that word selected > The quick, brown fox jumps over the lazy dog. > ^ > The quick, brown fox jumps over the lazy dog. > ===== selected > or have the day of a date selected but not the rest. > > Sincerely, > > Gene Wirchenko > Yes, it is possible. You need to look up 'selection' and 'range' in respect to 'javascript'. As a quickly googled example, take a look at: http://www.quirksmode.org/dom/range_intro.html ...and scroll down (about 3/4 page) to 'Creating a Range object from a Selection object' for some example code. -- Norman Registered Linux user #461062 AMD64X2 6400+ Ubuntu 10.04 64bit
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Input Controls Gene Wirchenko <genew@ocis.net> - 2011-12-29 18:11 -0800 Re: Input Controls Norman Peelman <npeelmandog@cfl.rr.com> - 2011-12-30 06:40 -0500 Re: Input Controls Martin Honnen <mahotrash@yahoo.de> - 2011-12-30 12:57 +0100 Re: Input Controls "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-30 10:49 -0700 Re: Input Controls RobG <rgqld@iinet.net.au> - 2011-12-31 15:21 -0800
csiph-web