Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting focus 1

Status
Not open for further replies.

coily

Technical User
Jan 26, 2005
25
GB
Hi,

I have a textbox that i need to set focus on each page load. I have done this with the following
Code:
<script language="JavaScript">
    function setFocus()
    {
      FindPerson.TextBox1.focus();
    }
  </script>
I then call this when the page loads, The problem is that it sets focus to the beginning of the textbox and not the end of the text within. This really is not what i want as I need the user to be able to add to the text in the textbox.

Any ideas how I can set focus to the end of the text in the textbox
 
Code:
<script language="JavaScript">
    function setFocus()
    {
      FindPerson.TextBox1.focus();
      [red]FindPerson.TextBox1.value = FindPerson.TextBox1.value;[/red]
    }
  </script>

vlad
 
Thanks for the replys guys,

VVlad your example worked treat

thanks to you both
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top