How to use the value element to pass values internally from $form to $form_state['value'] I have a form and i want to pass some values without user see them.

At the beginning i was using the default values:

$form['field_devis_lien_fiche']['und'][0]['value']["#default_value"] = t("@path",array("@path" =&gt; $path));


It was working fine but it's not the behavior i wanted because all the user could see the value.

So i buy "pro drupal 7 developpment" and at page 283, he describe the element value and i think this is what i have to use.

$form['title'] = array(
 "#type" =&gt; 'value',
 "#value" =&gt; $titre,
); 
$form['field_devis_lien_fiche'] = array(
 "#type" =&gt; 'value',
 "#value" =&gt; $path,
);


The $form['title'] works fine but all my other fields trigger an error.

Warning: array_values() [function.array-values]: The argument should be an array in _field_filter_items() (line 517 of ***/modules/field/field.module).
Warning: Invalid argument supplied for foreach() in text_field_validate() (line 119 of ***/modules/field/modules/text/text.module).
Notice: Undefined index: #language in locale_field_node_form_submit() (line 405 of ***/modules/locale/locale.module).


When i want to edit my content type, my value doesn't exist.

So i tried another solution with the hidden element:

$form['title'] = array(
 "#type" =&gt; 'hidden',
 "#value" =&gt; $titre,
); 
$form['field_devis_lien_fiche'] = array(
 "#type" =&gt; 'hidden',
 "#value" =&gt; $path,
);


In spit of the fact that my hidden fields are created when i inspect the form, i have the same error again (with array_value problem)

i don't understand why it's works for the title field and why it's not working for my other field. And i don't understand too, why i have an error with the hidden field as they appears well when i inspect element with firefox.

Do i have to create a validation function because of my element value? Maybe i have forgotten a step...

Thanks for the help.
The problem is that you'll need to set the type of the correct element to value, and that isn't what you've got at the moment. Notice how you use:

$form['field_devis_lien_fiche']['und'][0]['value']["#default_value"]


To access the field the first time round (which you've confirmed to be working). Logically then, if you want to change the same field to a value type, you need to do so on the same element:

$form['field_devis_lien_fiche']['und'][0]['value'] = array(
  "#type" =&gt; 'value',
  "#value" =&gt; $path,
);