select2 of multiple choice drop-down box upload

1. Add multiple: true, multi-attribute selected drop-down box style

2. The value of the drop-down box to select an array type can not be processed data form submission

When submitting the drop-down box where the original label is not submitted, but the value of multi-page election into a hidden tab, this will hide labels submitted

 

 

All the selected value acquisition time of filing of the drop-down box, and through the values, these values ​​respectively (values ​​separated by commas) into the form of a variable, and remove the last comma after the traversal is complete, the final format similar to 1, such 4,6,7

 

 Page initialization, if the incoming value, and will process the data into an array ( "# aa"). Val (arr) .trigger ( 'change') selected from the drop-down box into more binding by &

 

Guess you like

Origin www.cnblogs.com/clsl/p/11579157.html