--- title: Migrating from Select2 3.5 taxonomy: category: docs --- Select2 offers limited backwards compatibility with the previous 3.5.x release line, allowing people to more efficiently transfer across releases and get the latest features. For many of the larger changes, such as the change in how custom data adapters work, compatibility modules were created that will be used to assist in the upgrade process. It is not recommended to rely on these compatibility modules as they will eventually be removed in future releases, but they make upgrading easier for major changes. If you use the full build of Select2 (`select2.full.js`), you will be automatically notified of the major breaking changes, and [compatibility modules](/upgrading/backwards-compatibility) will be automatically applied to ensure that your code still behaves how you were expecting. The compatibility modules are only included in the [full builds](/getting-started/builds-and-modules) of Select2. These files end in `.full.js`, and the compatibility modules are prefixed with `select2/compat`. ## No more hidden input tags In past versions of Select2, an `` tag was recommended if you wanted to do anything advanced with Select2, such as work with remote data sources or allow users to add their own tags. This had the unfortunate side-effect of servers not receiving the data from Select2 as an array, like a standard `` element supports all core options, and support for the old `` has been deprecated. This means that if you previously declared an AJAX field with some pre-selected options that looked like: ``` ``` It will need to be recreated as a ` ``` The options that you create should have `selected="selected"` set so Select2 and the browser knows that they should be selected. The `value` attribute of the option should also be set to the value that will be returned from the server for the result, so Select2 can highlight it as selected in the dropdown. The text within the option should also reflect the value that should be displayed by default for the option. ## Advanced matching of searches In past versions of Select2 the `matcher` callback processed options at every level, which limited the control that you had when displaying results, especially in cases where there was nested data. The `matcher` function was only given the individual option, even if it was a nested options, without any context. With the new [matcher function](/searching), only the root-level options are matched and matchers are expected to limit the results of any children options that they contain. This allows developers to customize how options within groups can be displayed, and modify how the results are returned. ### Wrapper for old-style `matcher` callbacks For backwards compatibility, a wrapper function has been created that allows old-style matcher functions to be converted to the new style. This custom matcher uses a [compatibility function](/configuration/deprecated) that is only bundled in the [full version of Select2](/getting-started/builds). You can retrieve the function from the `select2/compat/matcher` module, which should just wrap the old matcher function.




>>>> This will work for any matchers that only took in the search term and the text of the option as parameters. If your matcher relied on the third parameter containing the jQuery element representing the original `
    

```

You would have previously had to get the placeholder option through the `placeholderOption`, but now you can do it through the `placeholder` option by setting an `id`.

```
$("select").select2({
    placeholder: {
        id: "-1",
        placeholder: "Select an option"
    }
});
```

And Select2 will automatically display the placeholder when the value of the select is `-1`, which it will be by default. This does not break the old functionality of Select2 where the placeholder option was blank by default.

## Display reflects the actual order of the values

In past versions of Select2, choices were displayed in the order that they were selected. In cases where Select2 was used on a `
```

...then you should now declare it as...

```

```

## Deprecated and removed methods

As Select2 now uses a `` element instead. If you needed the second parameter (`triggerChange`), you should also call `.trigger("change")` on the element.

```
$("select").val("1").trigger("change"); // instead of $("select").select2("val", "1");
```

### `.select2("enable")`

Select2 will respect the `disabled` property of the underlying select element. In order to enable or disable Select2, you should call `.prop('disabled', true/false)` on the `