how to create a form to hadle multiple file uploads?

1
0
-1

Hi, I'm using BOS 5.9

I'm designing the interface and I need to handle multiple docs uploading, The issue here is that it's not allways the same number of docs, so I can't insert a fixed number of file fields, nor create a fixed number of attachment vars in my process.

How can I accomplish my requirement, does anyone know a way to solve this?

Thanks in advance.

regards

jCor

Comments

Submitted by rafael.vianna on Thu, 12/05/2013 - 14:23

Hi jCor.

I'm curious as well about it.

Hope the answer do not comes with "javascript" inside. =p

Submitted by amine250 on Mon, 04/20/2015 - 02:39

Hi,

I found this answer though, which I can't quite get: http://community.bonitasoft.com/groups/usage-operation-5x/resolved-how-a...

1 answer

1
0
-1

Hi Amine,

you can't use that example in B6. the whole process for documents has changed since B5.

The only way to do a variable number of documents on a form in community is a variation of:

On your form add the maximum number of file widgets you are likely to encounter; F1-F20 Add a SimpleButton called Add A File and add a HTML Attribute:

onclick="addAFile();"

On the Form page add a HTML Widget at the bottom of the page with the following code as a CONSTANT;

<script>

//hide all file widgets on load
var noOfFiles = 0;
var maxFiles = 20;
for (var i=1; i<=maxFiles; i++){
document.getElementById('F'+i).style.display = "none";
}

function addAFile(){
// add a file opens (shows) another file
noOfFiles++;
document.getElementById('F'+noOfFiles).style.display = "";
}
</script>

Don't forget to set all the Output Operations on the files for when you click submit...

Document will be null when not added or incomplete.

regards Seán

Comments

Submitted by erendon789 on Thu, 07/23/2015 - 00:55

Sean McP do you have an example of it,

I´m trying to replicate what you wrote, but it doesnt work,

Im trying to add more than one attachment

Thanks

Regards

Notifications