Ozzy47
Well-known member
Prior to 2.3 we have something like this:
How would that be written for 2.3 (and still support 2.2)?
HTML:
<xf:js>
$(function()
{
$('.js-presetChange').change(function(e)
{
var $ctrl = $(this),
value = $ctrl.val(),
$form = $ctrl.closest('form');
if (value == -1)
{
return;
}
$form.find($ctrl.data('start') || 'input[name=start]').val(value);
$form.find($ctrl.data('end') || 'input[name=end]').val('');
$form.submit();
});
});
</xf:js>
How would that be written for 2.3 (and still support 2.2)?