?
Solved

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

Posted on 2004-10-08
4
Medium Priority
?
250 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

752 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