|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
I have this problem too - did you google?
http://www.mozilla.org/docs/dom/dom...range_ref8.html - if in doubt - RTFM! |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
manipulate the selection in an input type="text" element in mozilla
Quote:
Try this link for some ideas on selectionStart and selectionEnd: http://www.faqts.com/knowledge_base/view.phtml/aid/13562 -Jared |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Getting highlighted text from textfield in Mozilla |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|