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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focus

Status
Not open for further replies.

Craigii

Programmer
Feb 11, 2003
40
US
When a page is loaded, I need the page to; set focus to a certain textarea, scroll the page down to its location, and set the cursor to the end of the line. I am new to javascript and everything I have tried doesn't work. Any suggestions would be greatly appreciated.
 
I cannot answer accurately because my brain isn't thinking clearly, but hopefully the following will be of use to you - or maybe someone else will come along and gain inspiration and post a more complete answer.

You can scroll down the page using scroll() or scrollIntoView()

something like this:
<form>
<textarea name=&quot;box&quot;></textarea>
<div id=&quot;end&quot;></div>
</form>

<script>
scrollIntoView('end');
document.forms[0].box.focus;
</script>

At least I think that is right. Humn.. sorry.

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top