WEUI
<code> <div class="weui_cell weui_cell_switch"> <div class="weui_cell_hd weui_cell_primary">是否开车</div> <div class="weui_cell_ft"> <input class="weui_switch" type="checkbox" name="isdriver"> </div> </div></code>
<code> 原本的表单</code>
<code><input type="radio" name="isout" value="0" checked>内勤 <input type="radio" name="isout" value="1">外勤</code>
WEUI
<code> <div class="weui_cell weui_cell_switch"> <div class="weui_cell_hd weui_cell_primary">是否开车</div> <div class="weui_cell_ft"> <input class="weui_switch" type="checkbox" name="isdriver"> </div> </div></code>
<code> 原本的表单</code>
<code><input type="radio" name="isout" value="0" checked>内勤 <input type="radio" name="isout" value="1">外勤</code>
它这个开关打开以后,会给这个Input元素加一个checked属性,所以你只要给你获取这个checked属性的值
我的思路大概就是放在form表单中的一个隐藏input元素中一起提交
<code><input name="weui_switch_value" id="weui_switch_value" type="hidden"> <script> $(function () { $(".weui_switch").bind("click",function(){ $("#weui_switch_value").val($(".weui_switch").attr("checked")); alert($("#weui_switch_value").val()); }) }) </script></code>