Hi,

in Drupal 6 I had a working module, that altered some fields and their validation.
f.e. it changed the time field from text to a select input field with predefined options.
(of date field with pop-up calendar for the date and text field for the time originally)

in Drupal 7 it does not work the same way anymore.
on #after_build it calls a function, that contains

$form['field_zeitpunkt'][und][0]['value']['time']=array('#type'=> 'select');
$form['field_zeitpunkt'][und][0]['value']['time']['#options']=$options;

in Drupal 6 the code above created a select input with $options and I could use it, to enter the time.

in Drupal 7 the select is created, but the other attributes are missing. So I have to add
at least

$form['field_zeitpunkt'][und][0]['value']['time']['#name']= 'field_zeitpunkt[und][0][value][time]';

Why this? How can I just alter some of the attributes of a field, without loosing the other information?

Best regards

Adriana

If there is a tutorial about this, pleas tell me. I did not find anything that would help me in this question.