Topic: Material Select enable/disable via javascript
swipiidev free asked 7 years ago
rogertor pro answered 6 years ago
jgjgjgjhhjbjjh hjh jh jhj
Bartłomiej Malanowski staff 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
Josip Tomašev priority answered 7 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
Adrian Sawicki free answered 7 years ago
$(".mdb-select").material_select();
$(".mdb-select").material_select("destroy")
$("#FilterType").removeAttr("disabled")
$(".mdb-select").material_select();
Regards,
Adrian
swipiidev free answered 7 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
Magdalena Obalska free answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No