TomorrowHosting
02-12-2006, 04:15 PM
I am creating a new site, and I want it so you can add forum fields when you are viewing the page. This is so that you can add an unlimited number of files (to upload onto the server). So there will be one "file uploader field" however you could click the "Add Another File", and this would add another uploader field, so you could upload more than one file at the same time.
Any help on how to approach (or do) this would be great! :)
Real-Hosts
02-12-2006, 04:34 PM
Either have hidden div's and the button opens them up (you'll end up having a max amount. I'd say a max of 5 upload's per form submit anyway) using the div invisible and visible.
Or,
Have a JavaScript do it, in which case, it will count how many it already has put out, and then increment and put out more, making it dynamically named, which should work in correspondance with your processing script.
Either method has browser compatiability issues at some level.
The div visible/invisible would need IE5+ since last time I checked, FireFox spat on it.. And 2nd method, JS has to be enabled.
I'm sure google'ing it, or looking for sites which have such things (what came to mind was Google Mail's compose form) and looking at the source code for guidance on how it's handled.
Real-Hosts
02-12-2006, 04:37 PM
Just checked,
with JS disabled you'd have to make a popup box with all the max number of upload boxes, or have a pre-page, which asks how many uploads they want, and then only generates the form on the next page, but that sucks, people change their minds, so either JS with 'add another file upload' button - or have all the upload boxes on a popup box.
Remember,
PHP defaults to 2MB max upload per submit (I think, or is that per upload thread? Hmmm...)
TomorrowHosting
02-12-2006, 04:56 PM
I would be fine with doing a JS version. I definately don't like where you have to say how many fields you want before you go to the page, because as you said people change their minds.
I've looked at my statistics and over 99% of viewers have JS enabled, so I do not think it will be a problem.
Do you know of any resource, or template script that I could use as a reference?
Thanks! :)