View Full Version : Cursor Position in DateField

19 Mar 2012, 12:12 PM
I am trying to find the current cursor position in a datefield. I have a function that gets hit onkeyup and I tried getting the element by ID then getting the selectionStart but that doesnt exist for the div element. Has anyone had any luck getting the cursor position in a datefield object?

19 Mar 2012, 12:20 PM
More of a JavaScript question


19 Mar 2012, 1:06 PM
This seems to not work with the datefield object thats why I posted this here. I create the datefield and on "keyup" I enter a function that uses document.getElementById ('datefield') and then looks for selectionStart but it doesnt exist.

20 Mar 2012, 7:43 AM
I realized this is because the element I am getting by ID is the DIV itself. You need to go into the child elements to find the input tag.