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

SOLVED

Dynamically set image source path/value in AEM form designer

Firealan
Level 1
Level 1

Want to know how to dynamically call  the image source/path on certain conditions in form designer.

Currently I setup [image field] in the document. Wondering how I can use javascript to call / add the image into the image field .

 

I have tried to use the code below on [form:ready] 
this.value["#image"].href = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/SAP-Logo.svg/320px-SAP-Logo.svg.png"

 

But it didnt work.

 

Adobe Experience Manager - forms designer version : 6.5

 

My final goal is using XML data and javascript to dynamically change the path of the image. 

 

Hope someone have a solution/answer  for this question.

Thanks

1 Accepted Solution
Mayank_Gandhi
Correct answer by
Community Advisor
Community Advisor

@Firealan  I think you are doing correct just try the b64 string once. 

View solution in original post

5 Replies
Mayank_Gandhi
Correct answer by
Community Advisor
Community Advisor

@Firealan  I think you are doing correct just try the b64 string once. 

View solution in original post

Firealan
Level 1
Level 1
thank Mayank . the Base64data work. this.value["#image"].value = "BASE64DATA"
Mayank_Gandhi
Community Advisor
Community Advisor
@Firealan I think there was a approach to use URL as well, try checking embed image
GirishBedekar
Level 9
Level 9

You cannot change the image path using JavaScript