Editable select not adding new option mdbootstrao

A specific issue!

The editable-select component in MD Bootstrap (Material Design for Bootstrap) is a great feature, but it can be a bit finicky when it comes to adding new options.

Here are a few potential solutions to help you add new options to an editable select in MD Bootstrap:

  1. Use the append method: You can use the append method to add a new option to the select list. Here's an example:

    const select = document.getElementById('mySelect');
    select.append(new Option('New Option', 'new-option-value'));

    This will add a new option with the text "New Option" and value "new-option-value" to the select list.

  2. Use the options property: You can also use the options property to add a new option to the select list. Here's an example:

    const select = document.getElementById('mySelect');
    select.options[select.options.length] = new Option('New Option', 'new-option-value');

    This will add a new option with the text "New Option" and value "new-option-value" to the select list.

  3. Use the editable-select component's addOption method: If you're using the editable-select component from MD Bootstrap, you can use the addOption method to add a new option to the select list. Here's an example:

    const select = document.getElementById('mySelect');
    select.addOption('New Option', 'new-option-value');

    This will add a new option with the text "New Option" and value "new-option-value" to the select list.

  4. Check for any JavaScript errors: If none of the above solutions work, it's possible that there's a JavaScript error preventing the new option from being added. Check your browser's console for any error messages that might indicate the cause of the issue.

I hope one of these solutions helps you add new options to your editable select in MD Bootstrap!