HTML5 backrest controls not triggering change event?

We are currently using jQuery to start recounting in the form input field. Using HTML5, we get nice spinboxes in Safari (at least on Mac 5.0.3). However, updating a field using spinbox controls does not seem to raise a change event at all. It did not seem to be updated like a field. Is this just an oversight in WebKit? Or are there ways to get around this?

Edit: changing a spiner does not even raise an input event.

+4
source share
4 answers

$. click () is working fine. If you press and hold, this will not happen until you release.

+1
source

the change event is triggered when you enter the lost focus , and the value changes by pressing the button with the back, the input has not lost focus, so the change event will not be triggered.

0
source

You want to use the oninput event. Use something like $("...").bind("input", fn); .

See http://msdn.microsoft.com/en-us/library/gg592978(VS.85).aspx

0
source

This works for me on Chrome 11 and Opera 11.10:

 <fieldset class="col" oninput="exoutput.value = exnumber.valueAsNumber * exnumber.valueAsNumber;"> <legend>Output event handler</legend> <label for="exnumber">Number: </label> <input type="number" id="exnumber" placeholder="Enter a number" min="0" value="4" required> <label for="exoutput">Output: </label> <output for="exnumber" id="exoutput">16</output> </fieldset> 

Firefox 4 does not make valueAsNumber, but a small change makes it work in all three . Sorry, I do not have Safari for testing right now.

0
source

Source: https://habr.com/ru/post/1339114/


All Articles