Hi,

I would like to add filefield programmatically in my custom content creation form (like in the following post: http://drupal.org/node/330421). However, I first would like to allow more than 1 file upload, and, if possible, set a fixed number of uploads allowed according to the selection of a category from checkboxes above the upload form. Has anybody done such a thing? I am not sure where to start: JQuery maybe? Any recommendation?

Thanks for your help,

Comments

gafir777’s picture

Just a little more info:

For instance, the checkboxes allow the user to either pick: X Fiction or X Artwork
If Artwork is selected, then display one upload form, but allow to Add More up to 5 as Jpeg, Gif or PNG. If Fiction is selected, display one upload form for .doc or .pdf, and allow Add More up to three.

This is a pretty basic need for a content creation with a custom module, ... however, I'm not able to add the filefield programmatically and change the mime/type using javascript...

gafir777’s picture

Can Filefield be used as a type using the hook_form just like radios, textareas and such? How would you do to add it to a node module with the hook_form function or another function?

dopry’s picture

Status: Active » Closed (fixed)

no it can't be used as a type for forms... If you can figure out how to script the ui, feel free to, but it's a fairly complex beast.. I wish you luck,