...

View Full Version : focusing on text input field



glz
12-23-2007, 10:39 PM
How can I place the text cursor in a certain position among text in a <input type="text" /> form field?


for example let's say the input field contains this value:
hello

I want to place the blinking cursor before the 'h'
I want to place the linking cursor after the 'o'

How JS code do I need to do this?
I tried focus() but this just places the focus on the form field, and does not change cursor position.

Thanks

Philip M
12-24-2007, 07:47 AM
I am afraid that I do not understand the question. What is it which will cause the cursor to be placed before the 'h' or after the 'o'? User focusing on the field? If so what logic applies?

Have a look at:-

http://www.codingforums.com/showthread.php?t=87984



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum