How to alter a custom form
you need to add a validation to your form via

    $form['#validate'][] = 'yourFunction';


  function yourFunction($form, &amp;$form_state) {
        //to show the form values
        dpm($form_state);
        //do validation
  }