I have a form with a select list, and Jquery tying an onChange handler to that select. The handler is never called. On the Jquery side, I've tried these:
$("#dateShortcuts").on("change", function() { ... });
$("#dateShortcuts").change(function() { ... });
$("#dateShortcuts").on("change", myPredefinedFunc());
$(document.body).on("change", "#id", function() { ... });
$("#parentForm").on("change", "#dateShortcuts", function() { ... });
No matter what I try, I can't get the event handler to fire. My function is currently just alerting a string, so I know it when it works, but eventually it'll be adjusting two date pickers. My select list:
<select id="dateShortcuts" name="dateShortcuts">
<option value="-5">Since Sunday (last 5 days)</option>
<option value="0">Today Only</option>
<option value="-20">Days since May 1</option>
<option value="-1">Yesterday and Today</option>
<option value="-30">Last 30 Days</option>
</select>
I really don't know what else to try at this point. Everything I can find online says that one of those should work. I know Jquery itself is working, because it handles a lot of other tasks on the same page and does them all perfectly. I should also say that the samples I've already tried are all inside $(document.ready), where I (successfully) have onChange handlers for some text fields in the same form. Everything else is fine, it's just this select list that isn't working right. I've tested it on IE and Firefox. Thanks for any suggestions.