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.
Within the repeater “#repeater1”, I have text box “#text13” that I wish to activate an on-click event. When clicked, I want this to direct the user to the associated URL in a new tab. The URL is contained in the repeater’s associated dataset with its column labeled “website.” The “website” column is defined to contain URLs (not text, boolean, etc.).
I have used the following code:
import wixLocation from [‘wix-location’](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [;](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[$w.onReady(](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [function](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [ () { ](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[ $w(](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [‘#repeater1’](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [).onItemReady((selector, itemData, index) => {](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[ $w(](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [‘#text13’](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
}) [).onClick(() => {](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[ wixLocation.to(itemData.website);](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[ });](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[ });](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
[});](‘wix-location’;
$w.onReady(function () {
$w(‘#repeater1’).onItemReady((selector, itemData, index) => {
$w(‘#text13’).onClick(() => {
wixLocation.to(itemData.website);
});
});
})
When I play with this in preview mode, the arrow changes as I hover over the text as if I can click it as a hyperlink. However, clicking the text does not result in any event. To be sure I was not simply setting up bad links, I used the user interface to link a repeater image to the same URL column, and that works fine. The code, it seems, is not allowing me to open up the desired webpage.
I would really appreciate your help with this issue!