473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Set cursor position to the end of a text field ?

Hi,
I can set focus on a text field. But the cursor is always stay at the
beginning , how to set the cursor at the end ?

Thank you.

Aug 10 '05 #1
2 27313
Who
"duzuike" wrote
I can set focus on a text field. But the cursor is always stay at
the beginning , how to set the cursor at the end ?

Thank you.


In some browsers, including IE and FF, the trick is to set the value of the
element after setting the cursor. The cursor will then be moved with it as
the new value is written and end up at the end...

tt.focus(); tt.value = tt.value;

Otherwise, you will need to manipulate text selection ranges, which is a
pain to do crossbrowser.
hth
ivo
http://4umi.com/
Aug 10 '05 #2
Thank you for your valuable reply. It works.

Aug 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: supportgeek | last post by:
Greetings. Would anyone know the right direction to point me on this one? I need to read text from a Windows Application based on cursor position. And enter text based on what is read. ...
1
by: Barry | last post by:
Retoring Caret Position after text field correction -------------------------------------------------------------------------------- Hi, my code has the following form - function...
2
by: NewBob | last post by:
Since Access automatically highlights all of the text in a text control (I use it to hold data from a memo field) when the control is activated, I've added the following code to put the cursor at...
1
by: Tantra Veda | last post by:
Hello C# gurus, I have a question about finding cursor position in NumericUpDown control. On my form I have a numericUpDown control with 2 decimal places. I want to increment value in the numeric...
1
by: Paul | last post by:
Hi all, I am making a DirectInput application wich must report correctly the cursor position in windowed mode (it means it has to be the same as Microsoft Window´s cursor position). First of...
12
by: Sculder | last post by:
Hello, I'm running into an interesting issue and I wanted to verify it was a bug with Internet Explorer 7. I have a field that has an javascript onBlur event. When you set focus to the text...
1
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
We have some dumb and lazy people here, so I need help. To fix the dumb part: We have placed MaskedTextBoxes on the forms so they will stop entering the information incorrectly. Now the lazy...
0
by: nagarjunt | last post by:
Hi, This is nag. I have a problem with infragistics7.1 UltraTextEditor control. I am using C# code in windows form. I have UltraTextEditor control(With multi line enabled) in my Windows...
3
by: Rain Lover | last post by:
Hi, I just saw the following thread: http://bytes.com/topic/javascript/answers/157703-set-cursor-position-end-text-field The question seems to be answered, but I don't know how to include the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.