Bootstrap multiselect multi-choice function implementation method, bootstrapselect multi-Choice

Source: Internet
Author: User

Bootstrap multiselect multi-choice function implementation method, bootstrapselect multi-Choice

Official tutorial

Http://www.kuitao8.com/demo/20140224/1/bootstrap-multiselect-master/index.html

Usage:

Step 1 reference styles and related JS

<link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" type="text/css"/><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/bootstrap.min.js"></script> <!-- Include the plugin's CSS and JS: --><script type="text/javascript" src="js/bootstrap-multiselect.js"></script><link rel="stylesheet" href="css/bootstrap-multiselect.css" rel="external nofollow" type="text/css"/>

Step 2 construct Selection (note that you need to set the multiple attribute; otherwise, it will still be in single-choice mode, multiple = "multiple ")

<!-- Build your select: --><select class="multiselect" multiple="multiple"> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option></select>

Step 3 initialize the plug-in:

<script type="text/javascript"> $(document).ready(function() {  $('.multiselect').multiselect(); });</script>

Common Methods:

Select $ ('# cid'). multiselect ('select', arr [I]); set the selected items for the control

Get value

$ ('# Cid'). val (); obtain all the selected values of the control.

The above section describes how to implement the bootstrap multiselect multi-choice function. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.