Skip to main content
1 of 4
Dominic Woodman
  • 2.2k
  • 4
  • 36
  • 60

Ok so I was quite close. i got the solution from this post:

Solution

I created two separate form fields:

function createnode_form($form, &$form_state){ 

    $form['field_student_age'] = array(
      '#type' => 'textfield',
      '#title' => t('test'),
    );

    $form['field_student_age2'] = array(
      '#type' => 'textfield',
      '#title' => t('test2'),
    );

Then I stored them using the first method in the post quoted above:

$ewrapper->field_student_age[] = $form_state['values']['field_student_age'];
$ewrapper->field_student_age[] = $form_state['values']['field_student_age2'];

Rather than using set as I've done with single values I created a new entry for each value using [] =

Dominic Woodman
  • 2.2k
  • 4
  • 36
  • 60