2
我使用webform生成器,因为它是我通过CMS创建表单的唯一方法。我无法在呈现时手动编辑html代码,因此我必须使用jQuery进行操作。对于复选框标记输出是这样的:拆分复选框的数组,然后将它们包装到标签中
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_0" value="Masonry walls">Masonry walls
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_1" value="Attic">Attic
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_2" value="Non-masonry walls">Non-masonry walls
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_3" value="Roof">Roof
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_4" value="Foundation walls">Foundation walls
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_5" value="Floor">Floor
<br>
<input type="checkbox" name="CAT_Custom_1946925" id="CAT_Custom_1946925_6" value="Ceiling">Ceiling
<br>
我希望他们看起来像这个:
<label class="c-input c-checkbox">
<input id="radioStacked1" name="radio-stacked" type="checkbox">
<span class="c-indicator"></span>
Toggle this custom checkbox
</label>
这是可能的吗?