I am trying to modify a form element using hook form alter but I can't find the correct field name I am learning Drupal 7. I have a custom module, trying to modify a date form element in my page. I have the form id identified, and Devel module list me all the fields in this page, I think I am typing the correct field name but it doesn't work, It creates a new form element instead of modify the form element.
Maybe the element is inside a fieldset, but I don't know how to write the correct line to modify. It is a datepicker and I am trying to modify the minDate property for the date element.

Here is my code:

function davidcustom_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  drupal_set_message($form_id);  // print form ID to messages

  // Check when the right form is passed
  if ($form_id == 'commerce_cart_add_to_cart_form_24296') {

    $form['field_line_item_fecha_reserva'] = array(
      '#title' =&gt; t('Pick the desired date'),
      '#type' =&gt; 'date_popup',
      '#datepicker_options' =&gt; array(
        'minDate' =&gt; 10,
      ),
    );


  }

}
When you can't find an array key, the best thing to do is to dump the entire form array and search for it. If you use the Devel module, you can use the following:

dpm($devel);


This will give you a nice collapsible output through which you can search. Or you can use the old-school method that I use, and dump it directly using:

die('&lt;pre&gt;' . print_r($form, TRUE) . '&lt;/pre&gt;');