[thelist] js cursor position in a form

Brian Cummiskey Brian at hondaswap.com
Wed Jan 4 16:46:15 CST 2006

Hi all:

I have a problem with a select box and an input box.

Here's how it works.  The office_code is ALWAYS the 1st 4 digits of the 


Office: FLD2
RepId:  FLD212345

So, in the select dropdown for the office code, i've added an onchange 
event to call this simple function:

function populaterep() {
	var theform = document.getElementById("frmdefault");

	if (theform.office_code.value!="")
		theform.repid_number.value = theform.office_code.value;

which works fine, but it leaves my cursor blinking at the beginning of 
the input field, not after waiting for the repid number to finish.

Is there a way i can set the cursor to the END of a VALUE in the input box?

This is an internal app, IE6/pc only if it's some weird IE tweak, bring 
it on :)

Thanks in advance for some ideas.

More information about the thelist mailing list