mynot — 2012-05-14T04:35:09-04:00 — #1
I have a datepicker field setup like this and it works fine:
value='<?php echo $perfdate;?>'
class='date date_toggled order_date'
I would like to raise an alert when the value is changed. I've added this:
but it doesn't work. Anyone know how to make it work please?
cpradio — 2012-05-14T09:47:35-04:00 — #2
Not sure if this makes a difference, but you have the input marked readonly, so it should never change (which maybe why your alert isn't getting invoked)
mynot — 2012-05-14T15:14:55-04:00 — #3
Thanks. I removed that line and it makes no difference. Actually the fact that it's marked readonly doesn't mean it can't change, only that it can't be changed in the usual way of typing something into the box. It can still be changed by JS or php.
omgcarlos — 2012-05-15T13:53:31-04:00 — #4
Even then, changing the value of an input box programmatically won't actually trigger the onchange event...I know, weird. Wherever you're changing the value in your script, add:
or if you're using jQuery: