473,569 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 27324
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
2018
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. Example:(the interface of the windows application would look something like this.)
1
3256
by: Barry | last post by:
Retoring Caret Position after text field correction -------------------------------------------------------------------------------- Hi, my code has the following form - function ConvertOld(myfield) { if (myfield.inchange) return;
2
4247
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 the end. Private Sub txtCapability_GotFocus() ‘ Placed either behind the OnEnter or GotFocus Event of a control named, ' in this case,...
1
5077
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 box by 1 if my cursor is in front of the decimal point. If the cursor is after the decimal point, I want to increment the value by 0.1. How do I...
1
2381
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 all, I get Windows System Mouse Speed by using the function : SystemParametersInfo(SPI_GETMOUSESPEED, 0, &m_nMouseSpeed,0); After I am reading the...
12
11427
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 field, it launches a custom event handler to process the existing value in that text field. Well after the onBlur function has completed, the cursor...
1
9171
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 part: When our people click on a blank MaskedTextBox field, the cursor does not automatically go to the first "non-filled" mask value. For Example:...
0
2796
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 Form. A user can drag and drop a text(Usually from a tree node its name would be appended on drag and drop) in this control. Here user can put cursor...
3
1420
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 suggested code into my form embed code so the cursor be placed at the end of the default value: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.