Search code examples
jqueryjquery-mobile

Prevent multi select box to not change in multi check box on mobile browser


How to prevent multi select box to not change the view on mobile browser into checkbox?

Already tried the data-role="none" attribute but not working.

  <select multiple="multiple" data-role="none">
        <option value="USD">US Dollar</option>
        <option value="EUR">Euro</option>
        <option value="GBP">British Pound Sterling</option>
  </select>

Currently the output for this multi select box for mobile browser is shown in checkbox, and I want this as a default view of multi select box in mobile browser.


Solution

  • There is no data-role="none", but you can use the data attribute: data-native-menu="false".

    From the docs: "When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu."

    <select multiple="multiple" data-native-menu="false">
      <option value="USD">US Dollar</option>
      <option value="EUR">Euro</option>
      <option value="GBP">British Pound Sterling</option>
    </select>