michaelfurey Posted May 15, 2017 Share Posted May 15, 2017 I would like to create a select that shows immediately some option values without waiting that the user clicks on the arrow in order to see the option values... is it possible? Link to comment Share on other sites More sharing options...
requinix Posted May 15, 2017 Share Posted May 15, 2017 Sure. Do you have it at the point where it does everything except for that part? What's the code for it all? Link to comment Share on other sites More sharing options...
Jacques1 Posted May 15, 2017 Share Posted May 15, 2017 size Link to comment Share on other sites More sharing options...
requinix Posted May 16, 2017 Share Posted May 16, 2017 Ohh... Link to comment Share on other sites More sharing options...
michaelfurey Posted May 16, 2017 Author Share Posted May 16, 2017 This is my code: <script type="text/javascript"> $(document).ready(function() { $(".js-example-basic-single").select2(); }); </script> <select class="js-example-basic-single"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> <option value="fiat">Fiat</option> <option value="mercedes">Mercedes</option> <option value="bmw">BMW</option> <option value="tata">Tata</option> </select> Unfortunately I am using Select2 that is a plugin of jquery... I have the impression that the attribute size doesn't work with it. Link to comment Share on other sites More sharing options...
requinix Posted May 16, 2017 Share Posted May 16, 2017 select2 has a style for interacting with the list that doesn't work with the idea of showing options before they're selected. You need to choose which style you prefer. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.