Issue With Firefox: Event.target
I use the script below to replace some diacritical marks from legacy to standard form. Works fine in all browsers, except Firefox; where it does not work at all. I assume the probl
Solution 1:
Try this:
<formaction="whatever"name="whatever"method="post"onsubmit="return validate(event, this)">...</form>
And the function :
functioninlocuire_diacritice (ev, form) {
// form is a reference to the form element already// if you need event.target, use ev.target// this refers to the element to which this event is attached
:
}
Actually in FF (or in any modern browser) you don't need to pass arguments when invoking the function, in the function declaration you need to include one argument, which represents event
. this
in eventhandler refers to the element, to which the event is attached.
Please read about addEventListener
to see, how the listeners should actually be attached to elements.
Post a Comment for "Issue With Firefox: Event.target"