I create for my project a year/month enter widget in Yii.
(It is planned to be implemented as two <select> tags, one for a year and one for a month. I plan to reboot the page on every change (be it year change or month change). But that are unimportant details.)
I may pass 'onchange' attribute with some JavaScript to the widget in my PHP code.
Now to the question: This JavaScript should have access to the values year and month. How to pass these values to JavaScript code in an implementation agnostic way? (I mean that for example I may change the year input field to be a text input instead of a <select> or whatever changes we may wish). This change should not change the way year and month are passed to JavaScript.
Any ideas?