ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1.复选框是否选中 ~~~ {volist name="theme" id="vo"} <input type="checkbox" name="theme_id[]" title="{$vo.title}" value="{$vo.theme_id}" lay-skin="primary" {in name ="$vo.theme_id" value="$art.theme_id" } checked {/in}> {/volist} ~~~ 2.下拉框是否选中 ~~~ <select name="city_id" lay-verify="required" id="city"> <option value="">请选择城市</option> {volist name="city" id="vo"} <option {eq name="$art.city_id" value="$vo['config_id']"}selected{/eq} value="{$vo['config_id']}" >{$vo['value']}</option> {/volist} </select> ~~~ 3.复选框结果获取,并拼接成字符串 ~~~ function theme(){ var str=""; $('input[type=checkbox]:checked').each(function(){ str += $(this).val()+"," }); str = str.substring(0, str.lastIndexOf(','));//去除最后的‘,’; if(str===''){ str=0; } return str; } ~~~