Solved

Scroll to end of text in a text box on a page reload/text box focus

Posted on 2004-10-08
4
245 Views
Last Modified: 2012-08-14
So I have a text box which gets focus on a page reload.  Netscape puts the cursor at the end of the line, but IE puts me at the beginning.

DOES ANYONE KNOW how to move the cursor to the end of text in a text box?

<form name=myform>
<input type=text name=thattextbox value="somethingelse">
</form>
<script>
document.forms['myform'].thattextbox.focus();
//thattextbox.scrollTo(End);???????  Would this work????
</script>

Thanks,
Mike
0
Comment
Question by:oreomike
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
justinbillig earned 500 total points
ID: 12258404
document.forms[ 'myform' ].thattextbox.value += " ";

that should scroll to the end
0
 
LVL 13

Expert Comment

by:cLFlaVA
ID: 12258497
<BODY onload="document.the_form.the_text.focus();document.the_form.the_text.value+=''">
0
 
LVL 13

Expert Comment

by:cLFlaVA
ID: 12258528
or, to be completely anal:

<body onload="document.forms['the_form'].elements['the_field'].focus(); document.forms['the_form'].elements['the_field'].value += '';">
0
 
LVL 1

Author Comment

by:oreomike
ID: 12258607
thanks all

the first answer is what I was looking for
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question