CMS Request: Limiting the Selection Tags Input Element to One Selection Only
Collecting votes
Currently, it is not possible to set the Selection Tags input element to only accept one selection from the list of choices. In this element, visitors can select multiple options from the available choices.
Workaround
Using Velo, you can limit the Selection Tags input element to only allow visitors to choose one selection at a time.
Wix Editor
Editor X
Studio Editor
- Go to your Editor.
- Go to the page with the connected Selection Tags element.
- Enable Velo Dev Mode:
- Click Dev Mode at the top of the Editor.
- Click Turn on Dev Mode.
- Replace the gray text with the code below, after the first line: $w.onReady(function () {
1$w('#selectionTags1').onChange((event) => {
2 const indeces = $w('#selectionTags1').selectedIndices;
3 const singleIndex = indeces.slice(-1);
4 $w('#selectionTags1').selectedIndices = singleIndex
5 })
- (If needed) Replace selectionTags1 with the ID of your Selection Tags element. Click the relevant Selection Tags element to find its ID in the Properties and Events panel.
Note: Do not remove the hashtag (#) or apostrophes (') in the code.
We are always working to update and improve our products, and your feedback is greatly appreciated.