Wednesday 13 July 2016

How to add auto complete feature to text field in node form Drupal?

if ($form_id == 'test_node_form') {
        foreach($form['field_test']['und'] as $key => $value) {
            if (is_numeric($key)) {
                    $form['field_test']['und'][$key]['value']['#autocomplete_path'] = 'autosuggest-path';                    
            }
        }            
    }

No comments:

Post a Comment

Your comment is so valuable as it would help me in my growth of knowledge.