Results 1 to 3 of 3

Thread: Question about focus() and inputText field

  1. #1
    Join Date
    Aug 2008
    Location
    Western Europe
    Posts
    17
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Question about focus() and inputText field

    I'm using JavaScript to put focus on an <t:inputText> field, which is working. The field in question already contains text though, but the cursor is set at the beginning of the field and not at the end of the input. Does anyone know how I can fix this?

  2. #2
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    A quick search on google revealed this suggestion:

    "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;"

    Found at : http://bytes.com/forum/thread157703.html

  3. The Following User Says Thank You to rdutton For This Useful Post:

    Tohaki (10-29-2008)

  4. #3
    Join Date
    Aug 2008
    Location
    Western Europe
    Posts
    17
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the tip.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •