Form Load and Unload What are the functions  in Form API that perform the task just like form load and unload
I want to perform few checks when the form loads and delete those checks when the form is unloaded.

           function form_example_form($form, &amp;$form_state) {
                 $form['search'] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('Search for Members'),
                '#size' =&gt; 60,
                '#maxlength' =&gt; 128
                );
                $form['submit'] = array(
                '#type' =&gt; 'submit',
                '#value' =&gt; t('Search'),
                '#submit' =&gt; array('myform_newform_submit'),
                );
                 $header = array(
                    array('data' =&gt; t('ID'), 'field' =&gt; 't.id'),
                    array('data' =&gt; t('First Name'), 'field' =&gt; 't.fname'),
                    array('data' =&gt; t('Last Name'), 'field' =&gt; 't.lname'),
                    'operations' =&gt; array('data' =&gt; t('Operations'), 'colspan' =&gt; 2),
                  );
                if((variable_get('results'))!="") {

               $query = db_select('myform', 't')
              -&gt;extend('TableSort')        //Sorting Extender
              -&gt;orderByHeader($header)
              -&gt;extend('PagerDefault')
              -&gt;condition('lname',variable_get('results'),'=')
              -&gt;limit(2)
              -&gt;fields('t', array('id', 'fname', 'lname'));
              $results = $query-&gt;execute();
              foreach($results as $node)
              {
               $rows[]=array(
                    'id' =&gt; $node-&gt;id,
                    'first_name' =&gt;$node-&gt;fname,
                    'last_name' =&gt; $node-&gt;lname,
                   'modify' =&gt; l('Modify', 'myform/modify/'.$node-&gt;id),
                    'delete' =&gt; l('Delete', 'myform/delete/' . $node-&gt;id));
               }
               }
               else
               {
               $rows = array(); 
               }
            $form['pager_table'] = array(
              '#theme' =&gt; 'table',
              '#header' =&gt; $header,
              '#rows' =&gt; $rows,
              '#empty' =&gt; t('Empty Rows')
              );
              // attach the pager theme
              $form['pager_pager'] = array('#theme' =&gt; 'pager');
                return $form;
                                     }

                             function form_example_form_submit($form,&amp;$form_state)
               {
        variable_set('results',$form_state['values']['search']);
                   }


Now when I change the link how do I free the variable at form unload
Lets try this method 

on your form 

function form_example_form($form, &amp;$form_state) {
  $name = 'myname';
  $value = 'nikhil';
  variable_set($name, $value);
  // Your form elements goes here ...   
}

function form_example_form_submit($form, &amp;$form_state) {
  $name = 'myname';
  $myname = variable_get($name, $default = NULL);
  echo $myname; // will print nikhil
  variable_del($name);

}


As i dont know any Form Unload event i will do 

drupal_add_js("jQuery(document).unload(function() { 
//make an AJAX call to clear the value });", 'inline');


in javascript 

Good luck.