Expand my Community achievements bar.

SOLVED

Select single or multiple image in AEM forms

Avatar

Level 3

Hi,

 

I am trying to make a form in which i have to insert 8 - 10 images  and want user to select one of the image.  

I don't want to use radio buttons or checkboxes in front of each image. I want somehow user clicks on the image and it somekind of differentiates between the selected image and the rest..

 

Plz guide how to approach this.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee

You idea is basically good. Find a sample with a little trick in the link below.

The Selected Image field can be hidden and serves as the indicator for which image was selected. By using the same name for image and button you can build an "array" of objects where you check the .index . The calculate is the tricksy thing - when you press the button it overwrites the TextField - as we use the calculate of the button all the buttons changes their looks.

The designer will block the buttons when you enter a new calculate script. That will be corrected by the initialize line.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:2a954680-ba83-4523-bd30-445af6c7e85...

View solution in original post

5 Replies

Avatar

Employee
Is this a XDP Designer form saved as dynamic, interactive PDF or an Adaptive Form?How do the images come into the form?

Avatar

Level 3
@Kosta_Prokopiu1 I have inserted image via the "Image" field not 'Image Field" field. and now i want user to be able to select anyone of the image

Avatar

Level 3
@Kosta_Prokopiu1 I was thinking of making a transparent button over the image and when the user clicks it .. the button will change its edge style from none to Raised or Embossed or etched .. and again when clicked it will return to normal

Avatar

Correct answer by
Employee

You idea is basically good. Find a sample with a little trick in the link below.

The Selected Image field can be hidden and serves as the indicator for which image was selected. By using the same name for image and button you can build an "array" of objects where you check the .index . The calculate is the tricksy thing - when you press the button it overwrites the TextField - as we use the calculate of the button all the buttons changes their looks.

The designer will block the buttons when you enter a new calculate script. That will be corrected by the initialize line.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:2a954680-ba83-4523-bd30-445af6c7e85...

Avatar

Employee
I implemented a radio button style logic but you could change it into multiple selection if needed - the toggle would have to happen inside the button logic.