Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Dynamically changing Image component content on AEM Form from JavaScript

Avatar

Level 4

Hi All,

Is it possible to dynamically change the content of an Image component on an AEM Form.

For example if I have an image component set to “/content/dam/Banner 1.png” and I want to dynamically change it to “/content/dam/Banner 2.png”.

Thanks,
Robert

3 Replies

Avatar

Employee

Assign a CSS class to the image . The using jquery set its attr to the new location of the file  

Avatar

Level 4

Thanks workflowuser,

How do I use jquery to set its attr to the new location of the file?

I have set the CSS class to "image1" for example.

Thanks again for your help,

Best regards,

Robert

Avatar

Level 4

Thanks workflowuser,

How do I use jquery to set its attr to the new location of the file?

I have set the CSS class to "image1" for example.

Thanks again for your help,

Best regards,

Robert