顶部导航开始 -->

怎么获取checkbox选中的值,然后用Form表单提交走?


<div class="row cl">

 <label class="form-label col-xs-4 col-sm-2">电影分类:</label>

 <div class="formControls col-xs-8 col-sm-9">

  <dl class="permission-list">

   <dd>

    <label class="control">

     <input type="checkbox" value="" name="filmcategoryall" id="filmcategoryall">全部

    </label>

    <label class="control">

     <input type="checkbox" value="062F1B6E2082892E0286F1C8D51ED913" name="filmcategory" class="filmcategory">剧情         </label>

    <label class="control">

     <input type="checkbox" value="0FD1BDCF8FE8114423A30923FDDCD3C6" name="filmcategory" class="filmcategory" >悬疑       </label>

    <label class="control">

     <input type="checkbox" value="1281EBACB449D6441EB0203B01736178" name="filmcategory" class="filmcategory">动画

    </label>

    <label class="control">

     <input type="checkbox" value="18293A9880B2FB68CA8846AE85343F6A" name="filmcategory" class="filmcategory">励志

    </label>

    <label class="control">

     <input type="checkbox" value="2177A599D92CC4D9033C516AFA8C8B74" name="filmcategory" class="filmcategory">其他

    </label>

    <label class="control">

     <input type="checkbox" value="25656F5E22B194576BDF2770A6F00609" name="filmcategory" class="filmcategory">古装

    </label>

    <label class="control">

     <input type="checkbox" value="306B713983D7DBEC708C2DA7A41D0A64" name="filmcategory" class="filmcategory">西部

    </label>

    <label class="control">

     <input type="checkbox" value="3956D0BEBD79C1FB36109733E318ADCB" name="filmcategory" class="filmcategory">喜剧

    </label>

    <label class="control">

     <input type="checkbox" value="3C50B5EF155ADB460408D1D691046E20" name="filmcategory" class="filmcategory">偶像

    </label>

    <label class="control">

     <input type="checkbox" value="3D74C60E342083ABA51540FA35038AC5" name="filmcategory" class="filmcategory">动作

    </label>

    <label class="control">

     <input type="checkbox" value="40ABA83644018AF90CF02E49A90F4828" name="filmcategory" class="filmcategory">惊悚

    </label>

    <label class="control">

     <input type="checkbox" value="49A9EBE2597B7263753B15BE1AF1F148" name="filmcategory" class="filmcategory">魔幻

    </label>

    <label class="control">

     <input type="checkbox" value="4F4188F92B8C986407A99C12B87AF7B9" name="filmcategory" class="filmcategory">童话

    </label>

    <label class="control">

     <input type="checkbox" value="59B102476C43C0F4C9179875D0459FD1" name="filmcategory" class="filmcategory">幻想

    </label>

    <label class="control">

     <input type="checkbox" value="5B807318170B65CF3074EB4B430A274A" name="filmcategory" class="filmcategory">战争

    </label>

    <label class="control">

     <input type="checkbox" value="682D78E2EB3139B0E595D664A507B83E" name="filmcategory" class="filmcategory">恐怖

    </label>

    <label class="control">

     <input type="checkbox" value="6FD78F4F8D832A2D66B98AC35671EAF1" name="filmcategory" class="filmcategory">丧尸

    </label>

    <label class="control">

     <input type="checkbox" value="7070CF18A3B708BB49E4776E18F7B767" name="filmcategory" class="filmcategory">枪战

    </label>

    <label class="control">

     <input type="checkbox" value="724B904630FEE7E5B6A739777ED99447" name="filmcategory" class="filmcategory">歌舞

    </label>

    <label class="control">

     <input type="checkbox" value="83AD198D9CF9DC51DDC4FD5461FBE73D" name="filmcategory" class="filmcategory">纪录

    </label>

    <label class="control">

     <input type="checkbox" value="9E0ED3E2EFBECB32D3DB33CB3C2A15EB" name="filmcategory" class="filmcategory">暴力

    </label>

    <label class="control">

     <input type="checkbox" value="A0A6EABC33EB6502866424C45344978F" name="filmcategory" class="filmcategory">冒险

    </label>

    <label class="control">

     <input type="checkbox" value="AF5B8CC98860CFD32545B25CDE5DDEA8" name="filmcategory" class="filmcategory">讽刺

    </label>

    <label class="control">

     <input type="checkbox" value="BAC4E4ACD9A13DDAF6589BDC6727CB95" name="filmcategory" class="filmcategory">罪案

    </label>

    <label class="control">

     <input type="checkbox" value="BB2735586BD8CBDE6A19605504C938E3" name="filmcategory" class="filmcategory">谍战

    </label>

    <label class="control">

     <input type="checkbox" value="BF75D6B41C6DEBEA07EEFF31A2C61D46" name="filmcategory" class="filmcategory">灾难

    </label>

    <label class="control">

     <input type="checkbox" value="C9728315157392F04C5446F3FB7D14B3" name="filmcategory" class="filmcategory">生活

    </label>

    <label class="control">

     <input type="checkbox" value="CBE680D2220CB70BDFB5C3F532EF7A3E" name="filmcategory" class="filmcategory">同性

    </label>

    <label class="control">

     <input type="checkbox" value="DD8BBF1139DB056577E8AEC2D840CB00" name="filmcategory" class="filmcategory">爱情

    </label>

    <label class="control">

     <input type="checkbox" value="DF97C8B0E04F9B1023345CFE878EA2C2" name="filmcategory" class="filmcategory">传记

    </label>

   </dd>

  </dl>

 </div>

</div>

<div class="row cl">

 <div class="col-xs-8 col-sm-9 col-xs-offset-8 col-sm-offset-6">

  <!-- 隐藏域传递值 -->

  <input type="hidden" name="selectfilmcategory" id="selectfilmcategory" value="">

  <input type="hidden" name="selectfilmtag" id="selectfilmtag" value="48861FAC983973A2745369AD131FD7EA">

  <button type="button" class="btn btn-success radius" id="admin-role-save" name="admin-role-save">

   <i class="icon-ok"></i> 确定

  </button>

 </div>

</div>


自学php博客


$('input[name="filmcategory"]').change(function(){

   $('#selectfilmcategory').val($('input[name="filmcategory"]:checked').map(function(){

    return this.value}).get().join(',')

   );

});

//选择标签时,将选中的标签值传递到标签的隐藏域中

$('input[name="filmtag"]').change(function(){

   $('#selectfilmtag').val($('input[name="filmtag"]:checked').map(function(){

    return this.value}).get().join(',')

   );

});


自学php博客
请先登陆后发表评论
  • 最新评论
  • 总共0条评论
  • © 2014-2016 zixuephp.cn 版权所有
  • ICP证:皖ICP备16012107号
  • 联系邮箱:510082587@qq.com
  • 交流请加微信:weibobf2899 或扫下方二维码