T
Tim Streater
I'm aiming to replicate what Mac-Eudora does when you start to type in
an e-mail address into as it might be the To: field. If Eudora
recognises that you seem to be typing in a nickname that it can expand,
it:
1) completes the nickname and highlights the extra characters it has
entered
2) makes that whole nickname <strong>, or bold (but not the rest of the
To: line)
3) allows you to continue typing to complete the nickname or type a
comma to accept it and have it expanded
4) as you type, the highlighted area shrinks one char to the right at a
time
In thinking how I might do this, using onkeypress and onkeyup, I come
across setSelectionRange, startSelection and endSelection for use with a
textarea that I think might be useful in this context (found by some
amount of googling). But none of these is documented as far as I can
tell in for example Danny Goodman's or David Flanagan's JavaScript books.
These seem to work in Safari 4 beta and FF3 (both Mac), but I'm
concerned they might be deprecated or not be best suited for my needs -
or that they might be part of a useful and well supported set that for
some reason I'm going to have to discover one item at a time.
Comments/suggestions welcome.
an e-mail address into as it might be the To: field. If Eudora
recognises that you seem to be typing in a nickname that it can expand,
it:
1) completes the nickname and highlights the extra characters it has
entered
2) makes that whole nickname <strong>, or bold (but not the rest of the
To: line)
3) allows you to continue typing to complete the nickname or type a
comma to accept it and have it expanded
4) as you type, the highlighted area shrinks one char to the right at a
time
In thinking how I might do this, using onkeypress and onkeyup, I come
across setSelectionRange, startSelection and endSelection for use with a
textarea that I think might be useful in this context (found by some
amount of googling). But none of these is documented as far as I can
tell in for example Danny Goodman's or David Flanagan's JavaScript books.
These seem to work in Safari 4 beta and FF3 (both Mac), but I'm
concerned they might be deprecated or not be best suited for my needs -
or that they might be part of a useful and well supported set that for
some reason I'm going to have to discover one item at a time.
Comments/suggestions welcome.