Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Clearing a range created by element.createTextRange()

Clearing a range created by element.createTextRange()

a_edwill
02-03-2005, 11:40 PM
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!

ez4me2c3d
02-04-2005, 02:59 AM
can we get some code?

encoded
02-04-2005, 11:07 AM
You can try

<textrange>.collapse(false)
<textrange>.select()

jkd
02-04-2005, 03:40 PM
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!


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

write to an html file dynamically?
FireFox doesn't recognize history.go(-1)
Changing e.keyCode (e.which)
UPDATE: My mouse over pop up question
I am having problem with this script!!!
Creating Handlers
"Login ID" pass over to subsequent pages visited
Checkbox to manipulate Form Field

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics