The usecase is that a user may add a number of file-upload controls to a repeater, select files for them, then submit them all in one go.

One problem is, that if you have file-upload controls on a form, that have a file selected, they get submitted when you click on the repeater's add button, as these action-events submit the whole form.

This applies only to non-AJAX forms, I suppose.

No, this happens with Ajax-enabled forms

But in this case the repeater's add-button should only do an ajax- request and add the new contents behind the already existing repeater- rows. So I think the main problem is making the repeater AJAX-aware.


I would like to change this behaviour but do not know if this will break some other usecases.

Why do you want to change the behaviour? I think it is the common behaviour in all non-ajax-enabled upload forms, so I don't see the need. In your case you would, prior to uploading get the file names from all upload fields in the repeater that already have a value, store it in a hidden field, clear the original upload field, send it to the server and when the server responds, you will copy the file names from the hidden fields to the upload fields, right? What happens if JS is deactivated?

Tricks like this are not possible (if I understood you right) there is no API for setting the value of file-upload controls via javascript. It is locked down as a security issue.

Ok. I didn't know this,
--
Lars Trieloff
visit http://www.mindquarry.com/



Reply via email to