[thelist] js cursor position in a form

Brian Cummiskey Brian at hondaswap.com
Thu Jan 5 10:01:44 CST 2006


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();			
	}
}






<form id="frmdefault">			
.
.
.

<tr>
	<td class="txtr">Office Code:</td>
	<td><select name="office_code" onchange="populaterep();">
	<%= myholder %>   // asp derrived option list of office codes
	</select></td>
</tr>
<tr>
	<td class="txtr">Rep ID Number:</td>
	<td><input type="text" name="repid_number" /></td>
</tr>

.
.
.




More information about the thelist mailing list