I found an odd anomaly with HTML and JavaScript text fields that I narrowed down to be a feature of html / javascript, and I hope someone can educate me.
I downloaded and implemented a calendar plugin that creates a simple calendar layer and, when selected, transfers the selected date back to the text box.
What I want to do is catch when the text field changes (using onchange) and then call the Ajax function to update the database ...
The problem is that onchange is never called ... I was able to prove it with this very simple code below ... When the button is pressed, it changes the value, which then should trigger onchange and display a warning window ...
<input type="button" name="setValue" id="setValue" value="setValue" onClick="document.getElementById('textinput').value='Updated'"> <input type="button" name="clearValue" id="clearValue" value="clearValue" onClick="document.getElementById('textinput').value=''"><br> <input type="text" name="textinput" id="textinput" onChange="alert(this.name)">
Is this standard? Is there a workaround?
source share