Selecting multiple files in UploadAddForm.php

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 3, 2011   (RSS)

Hi All,

I'm trying to implement UploadAddForm.php (attached) in a photo upload application, and I’ve come up with 2 challenges.

1) My client would like to allow multiple images to be simultaneously selected while browsing, and then all of them uploaded when the form is submitted (the way the flash uploader works).

If I can do that, I think the "upload" step can be eliminated, since the record will be automatically “saved” after all the images have been uploaded.

2) I'd like to be able to check for missing "required" fields before an upload. Right now the errors only appear after a (possibly very large) image has been uploaded.

I've tried juggling the logic, but the only success I've had is getting the "required field" errors to show up as soon as the form loads.

Tim from Toledo Enterprises suggested using http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ as a (very cool) error checking solution, but I’d like to keep it in the page for now.

Any ideas?
Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Attachments:

uploadaddform_003.php 5K

Re: [gkornbluth] Selecting multiple files in UploadAddForm.php

By Jason - November 3, 2011

Hi Jerry,

In order to do this you will need to implement something like the flash uploader. There are a number of different scripts out there for this. CMS Builder uses a script called uploadify (cmsAdmin/3rdParty/jqueryPlugins/uploadify) (http://www.uploadify.com/).

If you want to check for required fields before uploading (ie, form submission), you will have to use some javascript, since you want the checks to happen on the client side, prior to being sent to the server. You can use the form's onsubmit event to do the check.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/