It looks like you're new here. If you want to get involved, click one of these buttons!
$fields['toggler'] = array('order' => 301, 'type' => 'toggler', 'label' => 'Media Type', 'prefix' => 'toggle_', 'options' => array('1' => 'Image', '2' => 'HTML'));
$fields['image'] = array('order' => 302, 'class' => 'toggle toggle_1 asset_select images');
$fields['html'] = array('order' => 303, 'label' => 'HTML', 'class' => 'toggle toggle_2 wysiwyg', 'type' => 'textarea');
Comments
For debugging, I renamed the fields to:
$fields['image_1']
$fields['html_1']
and toggling works, however these fields are not in the database so it's useless. very strange....
$(context).on('change.toggler', 'select.toggler, input[type="radio"].toggler:checked', function(e){ var context = $(this).closest('.form'); toggler(this, context); })