About jquery MultiSelect usage

Source: Internet
Author: User

I. The role of jquery MultiSelect

We make a comparison with the select tag. Select Tags I believe that we should all use, we do query often use the select as the condition to query, but select has a disadvantage, that is, you can only select one of the criteria to filter the query, select need to select a number of criteria query, That would be more troublesome to achieve. So the jquery MultiSelect is dealing with this. This is

After selection

Too much content is this effect

Second, usage

Referencing JS files and CSS files

Jquery-ui.min.js,

Jquery.multiselect.js

Jquery.multiselect.css

Jquery-ui.css

        $(function(){
ID Q_contractstatus is a value of the hidden field on the page, the foreground is selected, or the background is passed over to show. varSelected = $ (' #q_contractStatus '). Val (); Selected= ', ' + selected + ', '; vararr = Selected.split (', ');
Loop to determine which need to tick $ (' #contrStatus option '). each (function() { if(Selected.indexof (', ' + This. Value + ', ')! =-1) This. selected =true; });
Here is the main content $ (' #contrStatus '). MultiSelect ({header:true, Height:400, MinWidth:100, Checkalltext:' √ Select all ', Uncheckalltext:' X is not all selected ', SelectedText:' # is selected ', Selectedlist:4, Hide: [", 400], Noneselectedtext:' = = = Please select = = = ', close:function(){ varvalues1=$ (' #contrStatus '). Val (); if(values1==NULL){ $(' #q_contractStatus '). Val ('); } if(values1.length>0){
The selected value is placed in the hidden field, and the query is made directly with the hidden field $ (' #q_contractStatus '</script> <body> <select id= ' contrstatus ' name= ' contrstatus ' multiple= ' multiple ' style= ' width:190px ' > <option value= "1" > Contract pending sign </option> <option value= "2" > Confirm return </option> <o Ption value= "3" > Refused credit </option> <option value= "4" > Contract pending Confirmation </option> <option value= "5" Contract confirmed </option> <option value= "6" > Audit return </option> <option value= "7" > Contracted &LT;/OPTION&G T <option value= "8" > Pending loan </option> <option value= "9" > Loan failure </option> <option value= "1 0 "> Loan </option> <option value=" + "> Preliminary examination confirmed </option> <option value=" "" "" "> Review return </ Option> <option value= "$" > Contract timeout </option> <option value= "$" > Expiration paid off </option> <option value= "" "> Maturity due to principal and interest </option> <option value=" "" > Due liquidated damages </option> <option Value= "&G"t; one-time settlement </option> <option value= "<option" > Loan Review return </option> value= "$" > Financial lending back </ option> <option value= ">" Signed (resubmitted) </option> <option value= "One" > Lender withdrawal </option>& Lt;option value= "> Customer abandonment </option></select>

My code implementation is here, with a hidden field value I think clear.

Demo See Accessories

About jquery MultiSelect usage

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.