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?
getting focus on draggable form
Moderator: General Moderators
Re: getting focus on draggable form
Did you try anything like this? ...
Code: Select all
document.getElementById('formfield').focus() - kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: getting focus on draggable form
yeah...but because its draggable the focus is being lost i think...i'm trying to see if i can switch it on/offghurtado wrote:Did you try anything like this? ...
Code: Select all
document.getElementById('formfield').focus()
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: getting focus on draggable form
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?
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: getting focus on draggable form
and thats the thing...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?
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....