Skip to content

Dynamicly creation option elements breaks when value contain spaces #14

@AforDesign

Description

@AforDesign

When option elements are created dynamicly, the values need to be encapsulated.
Right now, this is not the case, resulting in broken html when values contain spaces.

To fix this, change:

                document.getElementById(this.selector).insertAdjacentHTML('beforeend',
                    "<option "+change_img+" "+change_icon+" "+change_separator+" "+change_disabled+" value="+properties.options[i].value+" >"+properties.options[i].inner_text+"</option>");

To:

                document.getElementById(this.selector).insertAdjacentHTML('beforeend',
                    "<option "+change_img+" "+change_icon+" "+change_separator+" "+change_disabled+" value=\""+properties.options[i].value+"\" >"+properties.options[i].inner_text+"</option>");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions