Closed Bug 329097 Opened 19 years ago Closed 19 years ago

input elements value truncated by maxlength

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 35230

People

(Reporter: dgunn, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 It seems that specifying the maxlength assigned to an input element takes precedence over the value assigned to that field. For example, <input maxlength=5 value="1234567890"> renders as an input field with "12345" in it. This behaviour seems to violate the expected behaviour; as we should have a way of limiting user input but still providing initial values for fields. The web developer should be able to enforce restrictions on user input, but be able to bypass these restrictions on provided initial values. As an example of functionality this would expose; Suppose the maximum length of a field in an application has been shortened. If the user then modifies an old dataset, he should be presented the entire value of the field, not some truncated version, he can then decide how to shorten it, not have the web browser arbitrarily cut off the last characters. For further incite into expected behaviour, MS IE6 will render the above element as desired. Thank you for your support. Reproducible: Always Steps to Reproduce: 1. Try to render a page containing <input maxlength=5 value="1234567890"> Actual Results: The input field will only display "12345", not allowing the user to see (and correct) the entire field. Expected Results: The software should have displayed the entire value "1234567890" inside the input field, the user will not be able to make any changes to the field other than deleting characters until the field is of a valid length.
For our reference: This bug corresponds to defect 63526 in our internal issue tracking system.
*** This bug has been marked as a duplicate of 35230 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.