Closed Bug 668817 Opened 13 years ago Closed 13 years ago

Changing the multiple attribute doesn't change the input element validity

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: mounir, Assigned: mounir)

References

Details

Attachments

(1 file)

Basically, if you do:
input.type = 'email';
input.multiple = true;
input.value = 'foo@bar.com, foo@bar.com';
// The input is valid.

But if you do:
input.type = 'email';
input.value = 'foo@bar.com, foo@bar.com';
input.multiple = true;
// The input is invalid.

Because when setting .value, the validity is computed but multiple is false, so the element is invalid. When setting multiple to true, the validity isn't updated so the element is still invalid.
Attached patch One-liner patchSplinter Review
This is going to be tested with bug 668816.
Assignee: nobody → mounir
Attachment #543439 - Flags: review?(jonas)
Whiteboard: [needs review]
Comment on attachment 543439 [details] [diff] [review]
One-liner patch

Review of attachment 543439 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good
Attachment #543439 - Flags: review?(jonas) → review+
Flags: in-testsuite+
Whiteboard: [needs review] → [inbound]
Pushed:
http://hg.mozilla.org/mozilla-central/rev/8da59b78d676
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: