Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38494

Re: on change trigger

From James Kirk <noneya.invalid@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: on change trigger
Date 2020-07-10 11:14 -0400
Organization Time Travel Tracing
Message-ID <20200710111426.1b76320a@james.kirk.invalid> (permalink)
References <jOqdnV3ui7CoRJrCnZ2dnUU7-RHNnZ2d@westnet.com.au>

Show all headers | View raw


In Message: <jOqdnV3ui7CoRJrCnZ2dnUU7-RHNnZ2d@westnet.com.au>
Andrew Poulos <ap_prog@hotmail.com> wrote:

> It seems that dispatching an event to an input within a form
> doesn't trigger the onchange event for the form:

Did you want it to 𝐛𝐮𝐛𝐛𝐥𝐞?

[snip]

> inpt.dispatchEvent(new Event('change'));

inpt.dispatchEvent(new Event('change',{bubbles: true}))

https://developer.mozilla.org/en-US/docs/Web/API/Event/Event#Example

> Where inpt is an input within a form f.

> Is that the expected behaviour?

Yes. bubbles default is false.

https://developer.mozilla.org/en-US/docs/Web/API/Event/Event#Values

-- 
James Kirk

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

on change trigger Andrew Poulos <ap_prog@hotmail.com> - 2020-07-10 12:57 +1000
  Re: on change trigger JJ <jj4public@vfemail.net> - 2020-07-10 16:03 +0700
  Re: on change trigger James Kirk <noneya.invalid@gmail.com> - 2020-07-10 11:14 -0400
  Re: on change trigger Julio Di Egidio <julio@diegidio.name> - 2020-07-10 23:33 -0700
  Re: on change trigger "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-07-11 17:52 -0700
    Re: on change trigger Andrew Poulos <ap_prog@hotmail.com> - 2020-07-12 13:44 +1000
  Re: on change trigger Arno Welzel <usenet@arnowelzel.de> - 2020-07-12 18:03 +0200
    Re: on change trigger James Kirk <noneya.invalid@gmail.com> - 2020-07-12 13:17 -0400
      Re: on change trigger Arno Welzel <usenet@arnowelzel.de> - 2020-07-13 17:24 +0200
        Re: on change trigger James Kirk <noneya.invalid@gmail.com> - 2020-07-13 13:35 -0400
          Re: on change trigger Arno Welzel <usenet@arnowelzel.de> - 2020-07-14 16:24 +0200

csiph-web