JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 8th, 2004, 04:36 PM
kkamen kkamen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 kkamen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Getting highlighted text from textfield in Mozilla

I'm having the following problem: there seems to be no way of getting highlighted text out of the textfield using JavaScript in Mozilla.

In IE the following call (document.selection.createRange().text) gets me the highlighted text anywhere on the page. In Mozilla window.getSelection() will only return the highlighted text if it's a static text on the page, and completely ignore any text entered into input fields.

Any help is appreciated.
-kk

Reply With Quote
  #2  
Old March 8th, 2004, 10:25 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
I have this problem too - did you google?

http://www.mozilla.org/docs/dom/dom...range_ref8.html - if in doubt - RTFM!
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old March 9th, 2004, 04:11 PM
kkamen kkamen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 kkamen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, I've googled and I've read the FM, and your point was?

I get a range object that is not null, but then how do I get it's contents? extractContents() and cloneContents() didn't do a good job either. toString() called on range doesn't return anything.

Any other ideas?

Reply With Quote
  #4  
Old March 19th, 2004, 03:24 AM
jds jds is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 jds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
manipulate the selection in an input type="text" element in mozilla

Quote:
Originally Posted by kkamen
Yes, I've googled and I've read the FM, and your point was?

I get a range object that is not null, but then how do I get it's contents? extractContents() and cloneContents() didn't do a good job either. toString() called on range doesn't return anything.

Any other ideas?

Try this link for some ideas on selectionStart and selectionEnd:

http://www.faqts.com/knowledge_base/view.phtml/aid/13562

-Jared

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Getting highlighted text from textfield in Mozilla


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway