Topic: MDB md-select md-outline

ayescas priority asked 3 years 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


Piotr Urbaniak free answered 3 years ago


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


ayescas priority answered 3 years 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 free commented 3 years ago

Could You prepare a code snippet in our editor?


ayescas priority commented 3 years 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(); });


ayescas priority answered 3 years ago


Awesome thank you so much !!!!


Piotr Urbaniak free answered 3 years ago


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



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: MacBook Pro
  • Browser: safari
  • OS: OSX
  • Provided sample code: No
  • Provided link: No