Standard
Select a sender
Select a sender
Sender is a required field.
Select a sender
Container(s) | .input-select-wrap |
Modifiers | .is-required .is-error .is-disabled |
HTML Elements | label.input-select-label select option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="input-select-wrap"> | |
<label class="input-select-label" for="select2-example-default">Sender</label> | |
<select id="select2-example-default"> | |
<option></option> | |
<option value="Jason">Jason</option> | |
<option value="Evan">Evan</option> | |
<option value="Katrina">Katrina</option> | |
</select> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#select2-example-default").select2({ | |
width: "100%", // sets inline width to 100% | |
minimumResultsForSearch: Infinity, // disables search | |
placeholder: "Select a sender", // show a placeholder | |
}).focus(function() { | |
$(this).select2("open"); // extend select2 to open on label focus | |
}); |