Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Selecting option in dropdown select not working as expecting

ignacio.ambia free asked 5 years ago


Hi everybody.

I am trying to select an option in a dropdown select automatically the select has the classes :

and to select the code i use :$('#select_department_update_jt_selector').val({option to be selected});

The code above works perfect but when i select an option with an '&' the page renders '&' as the option selected. Hope someone can help me

If I manually select the option, this doesn't happen.

I also tried running :$('#select_department_update_jt_selector option').filter(function() { return ($(this).val() == data.fk_department_job_title); }).attr('selected',true);

but the output is the same


MDBootstrap staff commented 5 years ago

Hi, Can you create a snippet with your code? https://mdbootstrap.com/snippets/ With your code example, I can test your use-case and find a solution. Best Regards, Piotr



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.6
  • Device: laptop
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No