I am loading a form and defaulting focus to the first text field. The text field is populated with a default value \"PW-\". (The first characters of the customers part numbe
Here's an EXAMPLE:
$(document).ready(function(){
var el = $("input:text").get(0);
var elemLen = el.value.length;
el.selectionStart = elemLen;
el.selectionEnd = elemLen;
el.focus();
});
https://developer.mozilla.org/en-US/docs/XUL/Property/selectionStart
https://developer.mozilla.org/en-US/docs/XUL/Property/selectionEnd
For older versions of IE you may need to use: http://msdn.microsoft.com/en-us/library/ie/ms536401(v=vs.85).aspx