The default bug view has changed. See this FAQ.

document.selection.createRange().text does not select text within form fields

RESOLVED INVALID

Status

()

Firefox
General
RESOLVED INVALID
13 years ago
12 years ago

People

(Reporter: Alex Lein, Assigned: Blake Ross)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1

This page is an example of how to return the selected text in javascript.
Firefox does not return selected text if the text is selected inside a
<textarea> or <input> field.

Reproducible: Always
Steps to Reproduce:
1. go to http://www.quirksmode.org/js/selected.html
2. enter some random text into the supplied <textarea>
3. select some or all of the text
4. press the Get Selection button/link

Actual Results:  
the <textarea> was cleared... no selected text was returned

Expected Results:  
the selected text should re-appear in the supplied <textarea>
Mozilla does this in a different way.
See:
http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/NSHTMLInputElement.htm
http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/NSHTMLTextAreaElement.htm
http://cgi.din.or.jp/~hagi3/JavaScript/Mozilla/SampleList.cgi?fmt=html
for example how it works in Mozilla.
(Reporter)

Comment 2

13 years ago
ok, i see.
perhaps this should be a feature request then.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Don't change it fo fixed.
It is a duplicate, invalid or a wontfix, but it is not fixed.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
The page has since been updated to use Mozilla-compatible code.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.