Form, populate select lists values after unsuccessfull validation I would like to have select values in my select lists that user poster to script. However when validation is not valid, those fields aren't populated with posted data, so user have to make the choice again. Could somebody give me any advice?

Code:

   for($i = 0; $i &lt; 3; $i++) {
            $form['register']['cocktails']['cocktail']['bartender_cocktail['.$i.'][]'] = array(
                '#type' =&gt; 'select',
                '#default_value' =&gt; variable_get('bartender_cocktail['.$i.'][]', NULL),
                '#options' =&gt; $cocktails,
            );              
        }
Your use of [] in the select name most likely confused the form API.

Try something like this instead:

for($i = 0; $i &lt; 3; $i++) {
  $form['register']['cocktails']['cocktail']['bartender_cocktail'][$i] = array(
    '#type' =&gt; 'select',
    '#default_value' =&gt; variable_get('bartender_cocktail_' . $i, NULL),
    '#options' =&gt; $cocktails,
  );              
}


Then, you need to set #tree to TRUE, so that you your cocktails into an array.

$form['register']['cocktails']['cocktail']['bartender_cocktail']['#tree'] = TRUE;


Then, you should be able to access the vaules like this: $form_state['values']['bartender_cocktail'].