Hi

I created a custom module to re-order image cck field 'title' and 'description' fields and change the type of 'description' field from text to textarea. I used 'hook_form_alter' to do the job. My form looks ok when I load the page but as soon as I hit 'Add another item' button to get a new field to upload a new image, my 'title' and 'description' fields reverts back to its originals. Their orders are not correct and 'description' type becomes text again. How can I fix this?

Thanks

Comments

hasozduru’s picture

Assigned: hasozduru » Unassigned
hallg9999’s picture

Having the same problem in Drupal 7

mdupont’s picture

Category: Bug report » Support request
Issue summary: View changes
Priority: Major » Normal
Status: Active » Closed (works as designed)

hook_form_alter() is not called for form elements refreshed via ajax, which is what the "Add another item" button does. You need to use another hook, preferably one attached to the field widget itself (check the CCK API for D6, in D7 it would be hook_field_widget_form_alter()).
Closing old issue.