I have a form with a multiple select field where a user can select several values in it
$form['export_type_section']['export_type'] = array( '#title' => t('Export types'), '#type' => 'select', '#multiple' => TRUE, '#size' => 10, '#options' => $options, '#ajax' => array( 'event' => 'change', 'callback' => 'test_export_form_export_type_ajax_callback', ), );
I have another field in the form
$form['document_type'] = array( '#type' => 'select', '#options' => array(0 => t('All Types'), 1 => t('Test1'), 2 => t('Test2'), 3 => t('Test3')), '#title' => 'Document Types', '#default' => 0, '#ajax' => array( 'event' => 'change', 'callback' => 'test_export_form_document_type_ajax_callback', ), );
I am trying to figure out how to reset the export_type field when the document_type is changed. I would like to clear the selected values so that the user can reselect what is needed whenever the document_type changes. I tried several formats in the test_export_form_document_type_ajax_callback but none worked.
Anybody knows how to do it?