How can i put an onchange function in this JHTML?
<?php
echo JHTML::_('calendar', $this->row->dates, 'dates', 'dates', '%Y-%m-%d',
array('class' => 'inputbox required validate-date') );
?>
I imagine it would be something like this but it breaks the calendar code:
<?php
echo JHTML::_('calendar', $this->row->dates, 'dates', 'dates', '%Y-%m-%d',
'onchange=\"thisfunction(this.form)\"', array('class' => 'inputbox required validate-date') );
?>
JHTML::_('calendar'...is actually calling JHTML::calendar passing your parameters. So if you take a look at the API you’ll find:This implies that your 6th param could be a array with additional HTML attributes. So you could just pass onchange in that array like: