A strange problem is that the chzn-select query of jQuery is invalid, and jquerychzn-select

Source: Internet
Author: User

A strange problem is that the chzn-select query of jQuery is invalid, and jquerychzn-select

A strange problem was encountered before, and the chzn-select query of jQuery failed. It is quite useful to use chosen of jQuery. This select statement can automatically query and match, which is more convenient than select2.

However, some places can be used but cannot be queried. Some places can be used again. After a long time, you still cannot find the reason. I used firebug and checked the code. It took a lot of twists and turns out the problem was finally found.

The original code is like this.

<Td> <select class = "chzn-select" id = "industryId" name = "industryId" data-placeholder = "industry" style = "vertical-align: top; width: 175px; "> <option value =" "> industry </option> <c: forEach items =" $ {listIndustry} "var =" industry "> <c: if test = "$ {paramMap. industryId = industry. industryId} "> selected </c: if >> {industry. industryName }</option> </c: forEach> </select> </td>

After modification

<Td> <select class = "chzn-select" id = "industryId" name = "industryId" data-placeholder = "industry" style = "vertical-align: top; width: 175px; "> <option value =" "> industry </option> <c: forEach items = "$ {listIndustry}" var = "industry"> <option value = "$ {industry. industryId} "<c: if test =" $ {paramMap. industryId = industry. industryId} "> selected </c: if >> {industry. industryName }</option> </c: forEach> </select> </td>

Move the position of the value to the same row as selected without any reason for the failure of searching. This situation is really tearful! If you can explain the reason, please reply and share it with me!


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.