Closed Bug 521310 Opened 15 years ago Closed 15 years ago

maxlength property of an input text box can be overridden by autocomplete value

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 444728

People

(Reporter: fosberry, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14 I've been testing writing some web forms, and I've observed that when I add maxlength property to an input box, that length is ignored by an autocomplete choice in that field. If I try to type beyond the maxlength, Firefox (correctly) does not let me, but if I select an autocomplete choice containing longer text than the new maxlength, the full selection is accepted as input. I expected the selection to be truncated to the maxlength value. Reproducible: Always Steps to Reproduce: 1.Enter long text in a web form for which you have source code. (for example, "Firefox" as a name) 2. Change (or add) a maxlength parameter to that field (maxlength=5) 3. Reload the page. 4. Start typing "Fire" in the field 5. Select "Firefox" as the choice in the autocomplete The browser accepts the full length "Firefox" instead of truncating the text to "Firef", just the first 5 characters. The choice of text and length don't matter, so long as the originally entered text is longer than the value you choose for maxlength. Actual Results: The browser lets me enter longer text via mouse selection. Expected Results: The text should have been truncated to maxlength characters.
Hello and thanks for reporting. I've already fixed this bug for Firefox 3.6 (Mozilla 1.9.2) in bug 444728 by not showing entries longer than maxlength.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.