Closed (fixed)
Project:
FileField
Version:
6.x-3.0-alpha6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2009 at 21:59 UTC
Updated:
5 Feb 2009 at 03:13 UTC
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
Comment #1
gafir777 commentedJust 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...
Comment #2
gafir777 commentedCan 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?
Comment #3
dopry commentedno 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,