2

The available options at the moment are Autocomplete term widget (tagging), Select list and Check boxes/radio buttons, but I'd like to use a widget without autocomplete.

Thanks in advance.

EDIT: To clarify: I'd like to use a widget where you're able to add comma separated tags, just like the current one, but without ajax.

  • An easy way might be to set it as autocomplete and then just unset() the ['#ajax'] part in a form_alter. – 2pha Feb 24 '13 at 13:05
  • Not sure I understand - as you've already mentioned you can choose 'Select list' or 'Check boxes/radio buttons' as an alternative to the autocomplete widget. Neither of those have autocomplete – Clive Feb 24 '13 at 13:25
  • 1
    @Clive I edited the question. – Alex Feb 24 '13 at 13:31
  • @2pha That would probably work. Do you think you could help me with that? I'm not very good with code :) – Alex Feb 24 '13 at 13:32
  • The hooks you will probably want to use is hook_form_BASE_FORM_ID_alter documented at: api.drupal.org/api/drupal/modules!system!system.api.php/…. Then all you need to do is unset() the specific ['#ajax'] item in the $form array. Without knowing your specific form id or the field id that you want to change, I really can't give any code that would be helpful. Why do you want to disable the autocomplete anyway? – 2pha Feb 25 '13 at 13:56
0

The code for the @2pha suggestion:

function MODULENAME_form_CONTENTTYPE_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_name']['#ajax'] = FALSE;
}

Your Answer

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

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