javascript - onchange on date inputs -


possible duplicate:
what events <input type=“number” /> fire when it's value changed?

i have date input field

<input type="date" name=".."> 

in webkit , firefox, added 2 up/down arrows on side of input. when clicking them, date goes forward or backwards, onchange event doesn't trigger until field loses focus. there workaround this?

you store value in global , check difference onclick.

<input type="date" name="mydate" id="mydate" />  var myapp = {}; myapp.mydate = "";  document.getelementbyid('mydate').onclick = function (e) {     if (this.value != myapp.mydate) {         // run onchange code          // set last value current value         myapp.mydate = this.value;     } }; 

see example →

edit: or, duplicate question, comments suggest. (see oninput event)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -