I posted a topic related to this problem in Russian JavaScript related site.
If you don't understand Russian try translated by Google version: http://translate.google.ru/translate?js=y&prev=_t&hl=ru&ie=UTF-8&layout=1&eotf=1&u=http://javascript.ru/forum/events/7771-poluchit-koordinaty-kursora-v-tekstovom-pole-v-pikselyakh.html&sl=ru&tl=en
Thre is some markup issues in the code examples in translated version so you can check them in original one.
The idea is simple. There is no easy, universal and cross-browser method to get cursor position in pixels. Frankly speaking there is but only for Internet Explorer.
In other browsers if you do really need to calculate it you have to create invisible DIV, copy all styles and content of the text box into that DIV, then insert HTML element at exactly the same position in text where the caret is in the text box and get coordinates of that element.