I have a form which I have included a reset button. Here is the code:
function submission_list($form, &$form_state) {
...code here...
$form['filter']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset'),
'#submit' => array('submission_list_reset'),
);
... more code ...
}
function submission_list_reset($form, &$form_state) {
if (isset($form_state['etd_filter'])) {
unset($form_state['etd_filter']);
$form_state['values']['filter_user'] = '';
$form_state['input']['filter_user'] = '';
}
$form_state['rebuild'] = TRUE;
}
I thought what I have in the submission_list_reset function is correct but it still displays whatever the user typed in the filter_user text field. I have tried clearing the values and input array with no success so I must be missing something really basic here. I have searched Drupal Answers and Google but have not found an answer. The answers I have found on Drupal Answers is about adding a reset button but not about clearing specific fields.
Thanks.