How to get Multiple Inputs

Hi there

I was thinking of implementing picture uploading to my web application.

Now there are few Uncertainties.It would be great if some one makes them clear.

How do you allow user to upload multiple data for Example. I have a model for car and I want user to add as many pictures with comments. Usually on websites there is button that says "Add another picture". If user clicks that button or link a text field and a Browse button appears and user can add as many pictures as he wants.

I think you should go through this wiki -

http://www.yiiframework.com/wiki/176/uploading-multiple-images-with-cmultifileupload/

Yii come with a widget Called CMultiFileUpload, is used to that type of tasks.

on the Class Reference u can get more information about.

See on http://www.yiiframework.com/doc/api/1.1/CMultiFileUpload/

ok but how do you upload data on custom request meaning that you have add another pic there. This will force us to go into tabular method to retrieve data ?

jqrelcopy extension or clientside jquery cloning.

Actually, users don’t like to enter comments before the upload. All they want is to select a couple of photos and click ‘upload’. It’s that simple.

I prefer using SWFUpload v2 (which is really cool) to provide multiupload and client-resize features.

After upload user can add or edit a description (I use jquery.jeditable for inline editing).

Anyway, you may also want to look at these plugins:

jquery.form (allows to upload files via AJAX)

jquery.dynamic-form (allows to clone form rows)