0

In my w2ui form, specifically the multiselect pop-up element, I have several options which contain ampersands (&). In the box itself, it shows correctly, but when w2ui renders the pop-up selection box, it shows them html coded as (&). Is there an easy work around to correct this so it shows up as (&) in the popup menu as well?

Edit: here is a breakdown of the script in use.

`

<html>
<head>
    <link rel="stylesheet" type="text/css" href="http://w2ui.com/src/w2ui-1.4.2.min.css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>    
    <script type="text/javascript" src="http://w2ui.com/src/w2ui-1.4.2.min.js"></script>
</head>
<body>

<input id="enum">


<script type="text/javascript">
    var assetList = ['ABIL DS&O 845','ADSO012001','ADSO012002'];
    $('#enum').w2field('enum', { 
        items: assetList
    });
</script>

</body>
</html>

`

  • Hey! Welcome to S.O. Can you show the code you're using to render the element, please? Edit your question to add that. – Gustavo Straube Sep 24 '15 at 19:53
  • I've appended a barebones version of the script which replicates the issue. If you save it as a page and open it, and type 'a' into the box, the popup will show the `&` in the list I'm trying to figure out – user5373688 Sep 28 '15 at 13:39

1 Answers1

0

Seems to be an issue with "markSearch".

Set markSearch to false, if that's an option for you.

var assetList = ['ABIL DS&O 845','ADSO012001','ADSO012002'];
$('#enum').w2field('enum', {
    items: assetList,
    markSearch: false,
});
Mike Scotty
  • 10,530
  • 5
  • 38
  • 50
  • That did the trick, thanks! Sorry took a few months to get back to you, we've been running our page with the bug in my question since then, but going forward it will be fixed! – user5373688 Jan 21 '16 at 14:14