By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

How to get caretPos or start and end points of selection in iframe for wysiwyg editor

P: 2
Hello,

I m not getting caretPos for iframe in Firefox... Also it doesn't give me selectionStart or selectionEnd points for iframe... code works fine for textarea also in FF.. but not for iframe..

I m using this code :

Expand|Select|Wrap|Line Numbers
  1. var startPos = document.getElementById('iView').contentWindow
  2.         .document.selectionStart;
  3. var endPos = document.getElementById('iView').contentWindow
  4.         .document.selectionEnd;
Here i m getting undefined value for startPos and endPos. here iView is my iframe editor. And i m getting problem only for FF. In Internet Explorer all works fine.

Can anyone help me out in this ??
Oct 29 '07 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
Hi and welcome to TSDN!

Try using contentDocument.
Oct 29 '07 #2

P: 2
hi

thanx for sujjestion. but contentDocument is also not working
Oct 30 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.