how to create a form to hadle multiple file uploads?
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
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:
On the Form page add a HTML Widget at the bottom of the page with the following code as a CONSTANT;
//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
Hi jCor.
I'm curious as well about it.
Hope the answer do not comes with "javascript" inside. =p
Hi,
I found this answer though, which I can't quite get: http://community.bonitasoft.com/groups/usage-operation-5x/resolved-how-a...