I'm working on an autocomplete feature for IE only using JScript that needs to highlight the last n bits of a string in an edit box. The highlighting works fine, but I cannot seem to clear the selection area. It looks like:
nnnnInnnn
where the blue area would be the area highlighted (selected) and the I the cursor.
I've tried everything. Nothing has worked so far. Any ideas on how to remove the highlighted (selected) text within the text box without losing cursor position at the end of the text area? Thanks!
encoded
02-04-2005, 11:07 AM
You can try
<textrange>.collapse(false)
<textrange>.select()
This is not DOM scripting. Moving to the Javascript forum.
a_edwill
02-04-2005, 09:16 PM
I must have tried every combination in the world except that. Thanks!