Hello Forum,
I have been searching for a way to connect a text box in my repeater to the associated URL link within my dataset. I found a couple of previous posts on this topic, but none of the example codes/solutions have worked for me thus far.
I am trying to add a section of recent posts
I have used the following code from here :
import wixLocation from 'wix-location'; import wixData from 'wix-data'; $w.onReady(function () { $w("#dataset1").onReady( () => { $w("#repeater4").onItemReady( ($item, itemData, index) => { $item("#text18").onClick((event) => { let myURL = itemData.website console.log(myURL) console.log(typeof myURL) wixLocation.to(myURL) }); }); }): });
When I tried to change my URL to any value like for example if I put
let myURL = "https://www.google .com" so its work fine.
Here is the error I am getting :
Please help me, what I am doing wrong or send me the correct code if you have. I appreciate your help. Thank you
1) Do you have connected your DATASET with a DATABASE?
2) Do you have checked the IDs of ---> DATASET / REPEATER / TEXT ?
3) Which result do you get for ---> console.log(itemData) ?
4) Can you show a little excerpt of the related DB ?