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
Something a little different: maybe try setting your "PW-" just in text to the left of the text input field. Validate against non-numbers in the field and then when submitting the form, prepend the "PW-" to that field's value, so that you have a complete part number.