English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The key sentence is:
$(".js-example-tags).select2( tags: true )
Don't underestimate the power of this code feature, simply add the class in the required place as shown in the following code:
<div class="form-group required"> <label class="control">-label col-sm-4">Test select2: </label> <div class="col-sm-8"> <form:select path="sett" id="sett" class="form-control required js-example-tags onchange="onchange('${sett.costAmount}','${sett.id}');"> <form:option value='' label='Please select' /"> <form:options items="${fns:findSettList()}" itemLabel="label" itemValue="value" htmlEscape="false" /> </form:select> </> </>
Note that there is an onchange method in the above code that needs to be replaced with
$(".js-example-tags).select2( tags: true )
added to this method. Otherwise, it cannot be realized.
The above is the BootStrap select introduced by the editor to everyone2This code can both query and input, and I hope it will be helpful to everyone. If you have any questions, please leave a message, and the editor will reply to everyone in time. I am also very grateful for everyone's support of the Nahan tutorial website!
Declaration: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email for reporting, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)