Topic: Material Select enable/disable via javascript
Magdalena Obalska answered 8 years ago
swipiidev answered 8 years ago
<div class="col-3">
<select name="SelectedFilter.FilterType" id="FilterType" class="mdb-select" disabled>
<option value="0">Customer has visited</option>
<option value="1">Customer has not visited</option>
</select>
</div>
Here is our javascript to initialise the select element:
$('.mdb-select').material_select();
We have tried using $('.mdb-select').material_select('destroy'); to remove the select then using $('.mdb-select').material_select(); to re initialise it, however the select element is still disabled (we want to enable it using javascript)
Can you please advise?
Thanks Adrian Sawicki answered 8 years ago
$(".mdb-select").material_select();
$(".mdb-select").material_select("destroy")
$("#FilterType").removeAttr("disabled")
$(".mdb-select").material_select();
Regards,
Adrian swipiidev answered 8 years ago
Josip Tomašev pro premium priority answered 8 years ago
$(".mdb-select").material_select();
$("#FilterType").material_select("destroy")
$("#FilterType").removeAttr("disabled")
$("#FilterType").material_select();
On page with more select field you can see flicker, but if only one field was affected less time need for rerender and you have less side effect on rest of page
rogertor pro answered 6 years ago
jgjgjgjhhjbjjh hjh jh jhj
Bartłomiej Malanowski staff pro premium commented 6 years ago
I think it's not that kind of content we're looking for. If you're having troubles with our library, please ask the real question. If you just want to follow this thread, you can use the "subscribe" button on the right sidebar of this page
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No