0

I am creating node after submission of some selected values of my custom made form. There is a CCK field in my content type called "Start Time(field_starttime)" for which I am selecting value from a select box in my form and trying to submit. But it's not getting done. Code in form for select list -

$select = taskform_timeelements();
  $form['fromtime'] = array(
    '#type' => 'select', 
    '#title' => t('From'),     
    '#options' => $select,
    '#prefix' => '<table><tr><td>',
    '#suffix' => '</td>',

  );

Where function for select list values looks like -

function taskform_timeelements(){   
    $hour = range(9,19);
    $select = array();
    foreach($hour as $record){  
        $select[$record.":00"] = $record.":00";
    }
    return $select;
}

Line which I have used for assigning value to the destined CCK field -

$node->field_starttime[]['value'] = $form_state['values']['fromtime';

Even I tried with this line -

 $node->field_starttime[]['value'] = '09:00';

But nothing happened. Node just got saved without any value for this CCK field.

4

0 に答える 0