頂部導航開始 -->

怎么獲取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號
  • 聯系郵箱:[email protected]
  • 交流請加微信:weibobf2899 或掃下方二維碼
双大床红利扑克1手APP