MDB md-select md-outline


Topic: MDB md-select md-outline

ayescas pro asked 4 months ago

After I make a selection from the select list, how can I make my value text white. It defaults to a grey color.

enter image description here


Hello ayescas,

I have created a code snippet that should solve Your problem: Select color change

Hope this solution will help You. If You have any further questions, feel free to write.Best regards


ayescas pro answered 4 months ago

Awesome thank you so much !!!!


ayescas pro answered 4 months ago

THANK YOU SO MUCH ; On the same subject, I'm using the following JS to change the icon colors. How can I apply for this to work on the md-select list:

//LocalDistrict  
const $iconLocalDistrict = $(".ico-LocalDistrict");
$("#g_LocalDistrict").focus(function() {
$iconLocalDistrict.removeClass("white-text").addClass("text-primary");
});
$("#g_LocalDistrict").blur(function() {
  if(!$(this).val()) {
    $iconLocalDistrict.addClass("white-text").removeClass("text-primary");
  }  
});

Piotr Urbaniak commented 4 months ago

Could You prepare a code snippet in our editor?


ayescas pro commented 4 months ago

Here you go, thank you. https://mdbootstrap.com/snippets/jquery/ayescas/2790798 When I add this to JS the code breaks: $(document).ready(function() { $('.mdb-select').materialSelect(); });


Hello ayescas,
You can try to use this code Icon color change

but generally the effect You want to achieve is difficult to achive with the current component structure.
Best regards


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.19.1
  • Device: MacBook Pro
  • Browser: safari
  • OS: OSX
  • Provided sample code: No
  • Provided link: No