Closed Bug 601877 Opened 15 years ago Closed 15 years ago

event listener for the invalid event does not work

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mattcoz, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20101002 Firefox/4.0b7pre Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20101002 Firefox/4.0b7pre When a form is submitted and an input fails the constraint validation an "invalid" event is fired. Setting the "oninvalid" attribute on the input works, but setting the "oninvalid" property or adding an event listener for the "invalid" event does not. Reproducible: Always
Version: unspecified → Trunk
There are two parts in this bug report: 1. HTMLElement has no oninvalid property (nor oninput or onchange, etc.) 2. addEventListener('invalid') doesn't work For 1. I will open a bug. But 2. seems to work for me.
Component: General → DOM: Events
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → events
Hardware: x86 → All
(In reply to comment #1) > There are two parts in this bug report: > 1. HTMLElement has no oninvalid property (nor oninput or onchange, etc.) I've open bug 618948 > 2. addEventListener('invalid') doesn't work I'm renaming this bug and will attach a test case.
Summary: oninvalid event not firing when assigned as property or event listener → event listener for the invalid event does not work
For 1. we should do the same as for other onfoo listeners: just add it to nsDOMClassInfo. We have already bugs open to change the way we register onfoo listeners.
Attached file Testcase
You should see an alert with the message "invalid event" if you press enter in the input element while empty. This should work on trunk.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: