Reputation: 69
I have an html element with default value as shown
<input type="text" id="start_date" name="start_date" value="2014-12-17" onClick="scwShow(this,this);" onFocus="scwShow(this,this);" class="textboxstyle">
On click of this input field, calender is getting opened from calender.js, after selecting/changing date, I want to do an ajax call, so I want to have onchange click event in my javascript. My javascript code is
$("#start_date").on("change", function(e){
console.log("changed date is:"+ $("#start_date").val());
});
But here on changing date from date picker in input field, onchange event is not triggering. Is that external library(calender.js) not allowing me to trigger onchange event after changing date? Any solution??
Upvotes: 1
Views: 706
Reputation: 19
There is just the "Data" input type with HTML5, use it instead of javascript/JQuery plugins!
<input type="date" onchange="yourfunction(e)">
Upvotes: 1