Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

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

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
oreomike
Asked:
oreomike
  • 2
1 Solution
 
justinbilligCommented:
document.forms[ 'myform' ].thattextbox.value += " ";

that should scroll to the end
0
 
cLFlaVACommented:
<BODY onload="document.the_form.the_text.focus();document.the_form.the_text.value+=''">
0
 
cLFlaVACommented:
or, to be completely anal:

<body onload="document.forms['the_form'].elements['the_field'].focus(); document.forms['the_form'].elements['the_field'].value += '';">
0
 
oreomikeAuthor Commented:
thanks all

the first answer is what I was looking for
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now