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

Dynamically changing Image component content on AEM Form from JavaScript

RobertBailey201
Level 4
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
workflowuser
Employee
Employee

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

RobertBailey201
Level 4
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

RobertBailey201
Level 4
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