<html>
<head>
<script language="javascript">
function test()
{
  var e = event.srcElement;
  var r =e.createTextRange();
  r.moveStart('character',e.value.length);
  r.collapse(true);
  r.select();
}function goTextB()
{
if(event.keyCode==39) form1.TextB.focus();
}function goTextA()
{
if(event.keyCode==37) form1.TextA.focus();
}</script>
</head>
<body onselectstart="return false">
<form name="form1" method="post" action="test.asp">
<input type="text" name="TextA" value="123" onfocus="test()" onkeydown="goTextB()">
<input type="text" name="TextB" value="123" onfocus="test()" onkeydown="goTextA()">
</form>
</body>
</html>