Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38502
| From | James Kirk <noneya.invalid@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: on change trigger |
| Date | 2020-07-12 13:17 -0400 |
| Organization | Time Travel Tracing |
| Message-ID | <20200712131711.574e32ad@james.kirk.invalid> (permalink) |
| References | <jOqdnV3ui7CoRJrCnZ2dnUU7-RHNnZ2d@westnet.com.au> <hn0qjdFo95rU1@mid.individual.net> |
In Message: <hn0qjdFo95rU1@mid.individual.net> Arno Welzel <usenet@arnowelzel.de> wrote: > Andrew Poulos: >> It seems that dispatching an event to an input within a form >> doesn't trigger the onchange event for the form: [snip] >> Is that the expected behaviour? > The expected behaviour is, that the event is fired when you changed > the input *and* the input loses the focus. It will not fired while > typing something to the input. d̲i̲s̲p̲a̲t̲c̲h̲i̲n̲g̲ ̲a̲n̲ ̲e̲v̲e̲n̲t̲? 𝐓𝐡𝐞 𝐜𝐡𝐚𝐧𝐠𝐞 𝐞v𝐞𝐧𝐭 𝐢𝐬 𝐟𝐢𝐫𝐞𝐝 … https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event#wikiArticle ¦ The change event is fired for <input>, <select>, and <textarea> ¦ elements when an alteration to the element's value is committed ¦ by the user. ¦ Depending on the kind of element being changed and the way the ¦ user interacts with the element, the change event fires at a ¦ different moment: ¦ • When the element is :checked (by clicking or using the ¦ keyboard) for <input type="radio"> and <input type="checkbox">; ¦ • When the user commits the change explicitly (e.g., by ¦ selecting a value from a <select>'s dropdown with a mouse ¦ click, by selecting a date from a date picker for <input ¦ type="date">, by selecting a file in the file picker for ¦ <input type="file">, etc.); ¦ • When the element loses focus after its value was changed, but ¦ not commited (e.g., after editing the value of <textarea> or ¦ <input type="text">). ¦ The HTML specification lists the <input> types that should fire ¦ the change event. https://html.spec.whatwg.org/multipage/input.html#concept-input-apply -- James Kirk
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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