I have an integer field on a node which can take two values. The nodes are created by the users by submitting a form. I can't work out how to do this for a multiple field text value.
How do I set-up a textfield form element to take multiple values?
How do I then submit it into the node using an entity wrapper?
This is the form element.
function createnode_form($form, &$form_state){
$form['field_student_age'] = array(
'#type' => 'textfield',
'#title' => t('test'),
); .....
This is the code that creates the new node.
function postajob_form_submit($form, &$form_state) {
$entity = entity_create('node', $values);
$ewrapper = entity_metadata_wrapper('node', $entity);
$ewrapper->field_salary->set($form_state['values']['field_salary']);
There is no multiple property for textfields. Do I need to open up a different path in the form variable (e.g. $form['field_student_age']['value1']
)? I've tried various options but I can't work out what the path would be.
If I do that, can I then just submit it in the wrapper with the extended path?