<Solved>Send Message from Page Code to HTML (Image & Database)

Hi Wix Code Team

I did manage to do the sending message from Page Code to HTML for text input only but I am not sure if images/ videos are possible to send to html? im not using upload button as the images are stored already in my DB.

I tried using src from manager file but it did not send except the text imput.
I read the HTML API and Article " Working with the HTML Component in Wix Code " but it did not mentioned anything about images.

If possible, I prefer getting the images from my database.

Thanks,
DA

Hi,
You can send a postMessage with the image / video URL and use it within the HTML component.

Good luck,
Tal.

Hi Tal

Thanks a lot for that confirmation. I will have to figure that out but if you have start up ideas/ code would appreciate that so much.

Thanks,
DA

Hey,
I forgot to add the documentation links :slight_smile:
Here you can find some explanations and examples:
Query function : To get the information from the collection.
Messaging : To send information from the page code to the HTML component.

I hope it’s clearer now :slight_smile:

Best,
Tal.

Would this work to pass data from an upload button to an iframe in order to render an image preview before a form is submitted?