It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Focus and Jump

Focus and Jump

Postby hegerp on Mon Nov 22, 2010 9:41 pm

Hi,

I need your help guys. I've got a little problem.

I have some smileys which I enter to a textarea when clicking on them. It works perfect, but once the user clicks on a smiley, the focus goes off of the textfield. I use document.getElementById('message').value += smileycode
It works perfectly, it enters the smileycode to the textarea.

My problem is... When I say document.getElementById('message').focus()
it goes back to where the cursors has last been so before the smileycode.

Instead of this, I want the focus to go back after the insertion of the code.

I hope it's understandable. And thanks in advance!
hegerp
 
Posts: 2
Joined: Tue Nov 16, 2010 4:22 pm

Who is online

Users browsing this forum: No registered users and 4 guests