Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to make an attachement required?

Avatar

Level 2

I want to block the submit of my form if the user has not attached at least one file to the form.

Is anybody can tell me how to do this?

4 Replies

Avatar

Former Community Member

I modifoed a sample that created for showing attachments to give you the idea. Have a look ane let me know if it does what you want.

Paul

Avatar

Level 2

I'm not sure this example is usefull for me.

I have a xdp form that is rendered under the LCES Workspace, when a user starts a process.

The attachment is added via the "Attachment" tab under the workspace. I have no field in my form for this attachment.

This is the presence of this attachment I want to check!

Do you know what I mean?

Avatar

Former Community Member

Yes I do .....I do not think that you will be able to determine if there is an attachment in the attachment envelope until you get the submission to the server. There you can check and if there is no attachment then return the task to the same user.

Paul

Avatar

Level 1

You can do that, but using scripted attaching of the files, using GetDataObject method and so on. There you can create some variable field, which will hold for example name of the attachment and add some kind of control script after ´Complete´ button clicked, or wherever you want to do it. There it will be also necessary to build script for adding attachment, for deleting it etc., with managing that mentioned variable holding the att info.

For common way = using paperclip in reader, there is probly no way how to manage this from the form, while this is not a function of the form itself and you´re not able to operate with this kind of data.

Hope you´ve got the idea.