0

I can change the "checkbox" to "radio" but it still allows more than one to be selected. What can I do to only allow a single selection? Here's the site: https://winkdiapers.com/product/os-pocket-diaper

  <div class="clearfix">
    {% for index, extra in product.extras %}
        <div class="extra">
          <label class="title" for="{{ 'extra-'~index }}">
              {% if extra.enabled %}
                  <input type="checkbox" id="{{ 'extra-'~index }}" {{ checkbox_state(postedExtras[extra.id], extra.id) }} name="extras[{{ extra.id }}]" data-ajax-handler="shop:product" data-ajax-update="#product-page=shop-product">
              {% else %}
                  <input type="checkbox" disabled="disabled">
              {% endif %}
            {{ extra.name }} ({{ extra.price|currency }})</label>
        </div>
    {% endfor %}
  </div>
{% endif %}


Bailey
  • 1
  • 3
    How was your try with radio inputs looking? Note that all the radio inputs must have the same attribute `name` value to be considered as a group – Kaddath Jan 21 '19 at 15:05
  • 2
    Grouping of radio buttons happens via the `name` attribute, so you need to add one. – misorude Jan 21 '19 at 15:06
  • 1
    Possible duplicate of [Multiple radio button groups in one form](https://stackoverflow.com/questions/28543752/multiple-radio-button-groups-in-one-form) – yunzen Jan 21 '19 at 15:12
  • I changed it to radio. Check https://winkdiapers.com/product/os-pocket-diaper – Bailey Jan 21 '19 at 15:24
  • There is already a name in the script – Bailey Jan 21 '19 at 15:29
  • There is a name but it's not the same. Are these inputs generated by a CMS / framework? the visual part is a `span` and the `input` is hidden.. – Kaddath Jan 21 '19 at 15:39

0 Answers0