<textarea> insertion point cursor positioning

I use the following Javascript to place the insertion point cursor in a <textarea> when the page loads: self.document.myPage.myTextarea.focus(); This puts it at the first character in the <textarea>. Is thre a way to place it after the last character in the <textarea> when there is default text there and the user is to add to it?

vogtsterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cLFlaVACommented:
Yup.

document.forms['myPage'].elements['myTextarea'].focus;
document.forms['myPage'].elements['myTextarea'].value += '';
0
cLFlaVACommented:
Whoa,

document.forms['myPage'].elements['myTextarea'].focus();
document.forms['myPage'].elements['myTextarea'].value += '';
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
k-doCommented:
You can modify your onload statement to the following:

self.document.form1.myTextarea.focus();self.document.myPage.myTextarea.value += '';

(Those are two single quotes at the end.)

Hope this helps,

Keith
0
k-doCommented:
Sorry - should've refreshed the page before I posted!  (and the form1 would've been myPage)

Keith
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.