1

I am using the following code.

   $form['usershare'] = array(
     '#title' => t('Share Collection Internally - Example: Alice, Bob, Pat'),                                                                                                                                                                                                                  
     '#type' => 'textfield',
     '#default_value' => empty($flag->usershare) ? '' : $flag->usershare,
     '#autocomplete_path' => 'user/autocomplete/fl',
     '#multiple' => TRUE,
   );

I installed the Autocomplete Deluxe module.

How do I convert the code I am using to have a form field that uses autocomplete deluxe?

I tried changing the form field type to autocomplete_deluxe, but that didn't work as only a blank input box shows up.

1 Answer 1

2

As per the README.txt file, something like this should work

   $form['field_term_ref_tid'] = array(
     '#type' => 'autocomplete_deluxe',
     '#autocomplete_deluxe_path' => url(
       'autocomplete_deluxe/taxonomy/field_term_ref',
       array('absolute' => TRUE)
     ),
     '#multiple' => TRUE,
     '#autocomplete_min_length' => 0,
     '#autocomplete_multiple_delimiter' => ',',
     '#not_found_message' => "The term '@term' will be added.",
   );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.