1

I need to programmatically save multi value in list text field in Node. E.g. I am having multi select drop-down of language field, I am getting value in

$languages = array('English', 'French', 'English (UK)')

I need to save in node :

$node->field_languages[$node->language] = array();

foreach ($languages as $language){

    $node->field_languages[$node->language][]['value'] = strtolower($language);

}

$node = node_submit($node); // Prepare node for saving

node_save($node);

Please help me out, How to save multi select value in list field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.