Topic: Select show placeholder even if there are options pre-selected
wwu22 free asked 3 years ago
Select should show pre-selected option if placeholder attribute is set.
Select show placeholder even if there are options selected.
Resources (screenshots, code snippets etc.)
Select doesn't have placeholder attribute. But you can do placeholder by yourself :D Sample code should look like this:
<select class="mdb-select md-form"> <option value="" disabled selected>Choose your option</option> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select>
First option is your placeholder. It value should be empty and it should have
selected attributes. Between
<option></option> tags you have to put your placeholder text.
And voila! You have your default option, that can't be selected second time, when you choose another.
You can see how our material select works here: https://mdbootstrap.com/docs/jquery/forms/select/#basic
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.16.0
- Device: MacBook
- Browser: Chrome
- OS: MacOS High Sierra
- Provided sample code: No
- Provided link: No