how to get form element value before submit in drupal i have form has first name and last name  field,and a custom login form,when user login it redirect to another page,and i want to get first name and last name fields in that page..,  

this is the way i tried...,

function doner_user_login(&amp;$edit, $account) {
  drupal_get_form('doner_step_3');
  $val=$form_state['values']['about_fname'];

  $edit['redirect'] = 'http://test.good.com/moll/ijs/d67/step31?fname='.$val.'';
}
Once an user has logged in, the GLOBALS $user with the information related to this user is ready to use. It isn't neccesary to add an argument to the URL in your redirection.

If it isn't loaded the information you want, you could store that variable in the $user object.

function doner_user_login(&amp;$edit, $account) {
  drupal_get_form('doner_step_3');
  $GLOBALS['user']-&gt;doner_variables = $form_state['values']['about_fname'];
}