[thelist] js cursor position in a form

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Thu Jan 5 10:18:03 CST 2006


Without knowing the line that triggers the error, I can't say for sure what the problem is, but I'd recommend creating the textRange *after* you fill the field.

Also, you should call select on oRange, not on the field itself.

Cheers,

Peter

 From: Brian Cummiskey Brian at hondaswap.com

Peter Brunone (EasyListBox.com) wrote:
> Which browser? Please show all the relevant code.

IE6.

function populaterep() {

var theform = document.getElementById("frmdefault");
var oRange = theform.repid_number.createTextRange();

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

oRange.moveStart("character", 4);
theform.repid_number.select(); 
}
}



More information about the thelist mailing list