在CF7中使用复选框作为单选按钮

时间:2019-07-07 18:27:04

标签: checkbox

我正在寻找一种方法,供用户在几周内选择联系表7中的几个选项之一。它们的行为基本上应该像单选按钮一样(一次只能选择一个,再取消选择以前的任何选择)。

问题是我不能一开始就使用普通的单选按钮,因为每个单选按钮的name属性都不同。

<span class="wpcf7-form-control-wrap checkbox_custom-3">
<span class="wpcf7-form-control wpcf7-checkbox_custom chkclass srok_razmesheniya" id="ch1">
<span class="wpcf7-list-item first last">
<label>
<input type="checkbox" name="checkbox_custom-3[]" value="20">
<span class="wpcf7-list-item-label">
1 week</span>
</label>
</span>
</span>
</span>
<span class="wpcf7-form-control-wrap checkbox_custom-4">
<span class="wpcf7-form-control wpcf7-checkbox_custom srok_razmesheniya" id="ch2">
<span class="wpcf7-list-item first last">
<label>
<input type="checkbox" name="checkbox_custom-4[]" value="40">
<span class="wpcf7-list-item-label">
2 weeks</span>
</label>
</span>
</span>
</span>
<span class="wpcf7-form-control-wrap checkbox_custom-5">
<span class="wpcf7-form-control wpcf7-checkbox_custom srok_razmesheniya" id="ch3">
<span class="wpcf7-list-item first last">
<label>
<input type="checkbox" name="checkbox_custom-5[]" value="60">
<span class="wpcf7-list-item-label">
3 weeks</span>
</label>
</span>
</span>
</span>
<span class="wpcf7-form-control-wrap checkbox_custom-6">
<span class="wpcf7-form-control wpcf7-checkbox_custom srok_razmesheniya" id="ch4">
<span class="wpcf7-list-item first last">
<label>
<input type="checkbox" name="checkbox_custom-6[]" value="80">
<span class="wpcf7-list-item-label">
4 weeks</span>
</label>
</span>
</span>
</span>

0 个答案:

没有答案