data-* attributes for each item. <option> elements to the Select. You can bind a Webflow CMS Collection to a Select form control using a jQuery-based data binding library like Rivets.js or Knockout.js, though jQuery alone is often sufficient for this. Webflow does not natively support binding CMS data to form controls, so this requires custom JavaScript.
div or span) that holds each item’s value using a class or data-* attribute (e.g., data-option-name).none so it doesn’t show on the live site.
"Please select a value").
</body>), add the custom script via Page Settings → Before </body> tag or a Site-wide Embed if site-wide.
Example:
<script>
$(document).ready(function() {
// Loop through each CMS item
$('.cms-option-item').each(function() {
var optionText = $(this).data('option-name'); // e.g., data-option-name="Category A"
var optionValue = $(this).data('option-value') || optionText;
// Append to the Select element
$('#your-select').append(
$('<option>', {
value: optionValue,
text: optionText
})
);
});
});
</script>
cms-option-item with your actual class and #your-select with your real Select element's ID or class.data-bind="options: yourArray"—but this is usually overkill in Webflow.
Use a hidden CMS Collection List and jQuery to read CMS item values and populate a Select form field. This method is Webflow-friendly and avoids the need for complex data-binding libraries unless your project demands more reactive data updates.