码迷,mamicode.com
首页 > Web开发 > 详细

js获取所选下拉框已经checkbox框内容的方法以及后台如何存储

时间:2018-03-16 15:13:04      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:如何   indexof   substring   nbsp   checked   val   body   ring   check   

function say() {
  var p = "";
  $("input:checkbox[name=‘checks‘]:checked").each(function() {
    p += $(this).val() + ",";
  });
  $("#atype").val(p);
  var se = "";
  $("select option:selected").each(function() {
   if ($(this).val() == "") {
    se +=",";
   } else if ($(this).val() == "1") {
    se += "<" + ",";
   } else {
    se += $(this).val() + ",";
   }
  });
  $("#options").val(se);
 }

 

 

<input type="hidden" name="atype" id="atype" value="" /> <input
     type="hidden" name="options" id="options" value="" />

String columns[] = null;

String atype = request.getParameter("atype");

String column = atype.substring(0, atype.lastIndexOf(","));

    columns = column.split(",");

js获取所选下拉框已经checkbox框内容的方法以及后台如何存储

标签:如何   indexof   substring   nbsp   checked   val   body   ring   check   

原文地址:https://www.cnblogs.com/cyfs/p/8581308.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!