How do I make a custom free tagging form in drupal 4.7.0? I really need to change the 'maxlength' parameter for a taxonomy field and populate it with the list of taxonomies.

Please help! (><)

Comments

myriad’s picture

I still can't get this to work.
The vid I need to edit is 3, so for example:
$form['taxonomy']['tags'][3] = array('#type' => 'textfield', '#default_value' => $cast, '#maxlength' => 1024, '#autocomplete_path' => 'taxonomy/autocomplete/3', '#weight' => -2,'#required' => TRUE, '#title' => t('Movie Cast'), '#description' => t('A comma-separated list of the English spelling of actors and actresses in this movie.'));
Does nothing to my forms. However is I make the vid 30 instead of 3, the field shows up! (but obviously not where I want it)
I've also tried the form_alter function, but it's the same thing.

I had to modify the core taxonomy.module to change the maxlength to 1024. it works, but defeats the purpose of having modules.

please teach me an alternative!

nevets’s picture

The taxonomy module does it magic by using the form_alter hook. So if your module was called fish, it would add the form field and the taxonomy module would replace it. If on the other hand your module was called zebra what you show should work.

myriad’s picture

It was a good shot, but nothin changed. I tried changing the taxonomy to ZZ and the module name to start with Z, I tried different weights, but alas, nothing has changed.

I do have a feeling it is the order of the $form modifiers that is causing the trouble. I'll try to find out how to get taxonomy.module to go first as this will happen again with future modules.

Through trial and error, I know that if i do a $form = array(); nothing shows up, not even taxonomies. But anything else, and it's all back.

any more ideas?