Solved

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

Posted on 2004-10-08
4
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

724 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