ciao, sono nuovo del forum.
ho trovato questo script online per acquisire la posizione del cursore in una textarea:
codice:
var $textArea = { GetCaretPos: function (elm) { var currentPos = 0; if (document.selection) { elm.focus(); var curRange = document.selection.createRange(); curRange.moveStart('character', -elm.value.length); currentPos = curRange.text.length; } else if (elm.selectionStart || elm.selectionStart == '0') { currentPos = elm.selectionStart; } return currentPos; }
per le textarea funziona ma per iframe con designmode="on" no.
qualche suggerimento?
grazie in anticipo