aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Setting cursor to a field Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Setting cursor to a field" Watch "Setting cursor to a field" New topic
Author

Setting cursor to a field

Jiri Nejedly
Ranch Hand

Joined: Oct 22, 2002
Posts: 75
I use this javascript code to set cursor and select text in a field

document.getElementById(field).focus();
document.getElementById(field).select();

It works OK in IE 6 but I have problem in Mozilla:
- Selection and cursor are not visible, but cursor is on place after last char
- Leaving this field triggers onchange event - why? I Didn't change this field.

Any comments will be welcomed, thanks.
[ December 18, 2007: Message edited by: Jiri Nejedly ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Setting cursor to a field
 
Similar Threads
Common cursor for 2 PL/SQL functions
Inconsistent focus on input field
how to disable if one or more check boxes selected
showing cursor in textBox
focus() function