<TEXTAREA, Focus Question

R

rebeccatre

<form name=hi><textarea name=blue there>HELLO</textarea></form>

<script>
function loadtest(){
document.forms['hi'].elements['blue'].focus();
}
</script>

<a href="javascript:loadtest()">test-jump_toend</a>

hello, please help me with this. i am needing it to jump to the end
of the populated text. can this be done and show me how?
 
R

RobG

<form name=hi><textarea name=blue there>HELLO</textarea></form>

<script>
function loadtest(){
document.forms['hi'].elements['blue'].focus();}

</script>

<a href="javascript:loadtest()">test-jump_toend</a>

hello, please help me with this. i am needing it to jump to the end
of the populated text. can this be done and show me how?

Kludgy, but should work most places:

function loadtest(){
var el = document.forms['hi'].elements['blue'];
if (el) {
el.value = el.value;
el.focus && el.focus();
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,883
Members
47,414
Latest member
djangoframe

Latest Threads

Top