wongadob Posted August 3, 2012 Share Posted August 3, 2012 (edited) I have a password entry box and I am trying to display the character that the user has entered. I am aware of the jQuery pluggin dpassword which replicates the iphone input, but I need a little more control. I have the system pretty much working based on another solution. However the one thing I need to know is how to find out the screen Top, Left position of the carat. Any ideas how I can get this. I have seen solutions that give you the character index into the text area, but I need the screen position as I want to display the currently entered character immediately infront of the last character. I am sure there must be some way of finding this out. even if it is just relative to the start of the password entry box (as I am sure I can get that's Top Left co-ordinate. Thanks for the help Wongadob Edited August 21, 2012 by wongadob Link to comment Share on other sites More sharing options...
wongadob Posted August 5, 2012 Author Share Posted August 5, 2012 Is this possible? With 31 people reading this and no replies makes me worry that it can't be done? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 6, 2012 Share Posted August 6, 2012 If you can get the position of the caret inside an element, you can also get that element's position to get the position of the caret on the page. http://www.google.com/search?client=opera&rls=en&q=javascript+get+coordinates+of+caret&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest Link to comment Share on other sites More sharing options...
wongadob Posted August 21, 2012 Author Share Posted August 21, 2012 Thanks that is what I did eventually. Multiplying by 6 (width of asterisk) to get screen poistion Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now