Page 1 of 1
getting focus on draggable form
Posted: Mon Jul 28, 2008 7:50 pm
by kendall
Hi,
I have a div tag which i have made into a draggable object. in this div tag i have loaded a html form. However what i shappening is that the form input elements are not receiving focus when trying to input data.
Is there anything that I can do to give focus precedence to the input form over the div?
Re: getting focus on draggable form
Posted: Thu Jul 31, 2008 2:32 pm
by ghurtado
Did you try anything like this? ...
Code: Select all
document.getElementById('formfield').focus()
Re: getting focus on draggable form
Posted: Thu Jul 31, 2008 2:35 pm
by kendall
ghurtado wrote:Did you try anything like this? ...
Code: Select all
document.getElementById('formfield').focus()
yeah...but because its draggable the focus is being lost i think...i'm trying to see if i can switch it on/off
Re: getting focus on draggable form
Posted: Thu Jul 31, 2008 2:53 pm
by jayshields
Whatever mechanism you've got for dragging stuff around, make it store whatever has focus before the dragging, and then set whichever element had focus before to have it again after the dragging has finished?
Re: getting focus on draggable form
Posted: Thu Jul 31, 2008 6:50 pm
by kendall
jayshields wrote:Whatever mechanism you've got for dragging stuff around, make it store whatever has focus before the dragging, and then set whichever element had focus before to have it again after the dragging has finished?
and thats the thing...
what i find strange is that i have links within the div that i am able to click on....However, the input elements are being "loaded" (AJAX) in on an onclick....I tried using onLoad to set a focus but If the user were to try and use the mouse rather than the "tab" the focus is lost.
i'm re-evaluating using the drag....