In user content it would be great to have an image option rather than just text with the radio buttons. These thumbnails could also open to a bigger image so the user can see more easily what it is they are selecting.
I have got round it by adding thumbnails next to the radio buttons with the text but it would be great to have this as an image selection option.
I’m not sure this will completely cover your desired behavior, but keep in mind you can also use a gallery and listen to its OnItemClicked event using JavaScript. It wouldn’t look like radio buttons, but would allow you to select from a row of images.
Thanks Uval, I did wonder if I could do that but would it then send the selection to the database?
I have just tried adding a gallery but you cannot connect it to a dataset so that won’t work unfortunately
you can, using a bit of JavaScript magic.
What I’m doing in the code below is using the event to get the index of the selected image (using event.itemIndex), and then setting the dataset’s field ‘mySelectionField’ to the value. Depending on your case, you may want to set something else.
export function gallery1_onItemClicked(event) {
let selectedItem = event.itemIndex;
$w('#dataset1').setFieldValue('mySelectionField', selectedItem);
}
can someone help me out on how to do this from start to finish? new to corvid and java with wix