How to reset specific form elements I have a form which I have included a reset button. Here is the code:

function submission_list($form, &amp;$form_state) {

  ...code here...

  $form['filter']['reset'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Reset'),
    '#submit' =&gt; array('submission_list_reset'),
  );

  ... more code ...
}


function submission_list_reset($form, &amp;$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.
You can attach the reset function in this way:

function submission_list($form, &amp;$form_state){
  $form = array();
  $form['name'] = array(
    '#title' =&gt; 'Name',
    '#type' =&gt; 'textfield',
  );
  $form['surname'] = array(
    '#title' =&gt; 'Surname',
    '#type' =&gt; 'textfield',
  );
  $form['actions'] = array(
    '#type' =&gt; 'actions',
    'submit' =&gt; array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Submit'),
      '#attributes' =&gt; array(
        'class' =&gt; array('my-submit-button-class')
      ),
      '#submit' =&gt; array('your_submit_function')
    ),
    'reset' =&gt; array(
      '#type' =&gt; 'submit',
      '#attributes' =&gt; array('class' =&gt; array('my-reset-button-class')),
      '#value' =&gt; t('Reset form'),
      '#submit' =&gt; array('submission_list_reset')
    )   
  );
  return $form;
}

function submission_list_reset($form, &amp;$form_state) {
  $form_state['values']['name'] = '';
  $form_state['values']['surname'] = '';
}

function your_submit_function($form, &amp;$form_state) {
  drupal_set_message('The form has been submitted');
}


But please consider to use ajax callback for this reset function, it would be better do not reloading the page only because of resetting. More info - Ajax forms in Drupal 7