Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Prevent first option topOptionText from being clickable #14

Open
amazingBytes opened this issue Mar 22, 2012 · 0 comments
Open

Prevent first option topOptionText from being clickable #14

amazingBytes opened this issue Mar 22, 2012 · 0 comments

Comments

@amazingBytes
Copy link

To prevent the first option from being clickable I'd like to suggest the following addition of a function and a slightly change of code.

New function:

//function to create first option in the select menu
function createFirstOption($container){

        $('<option selected="selected" disabled="disabled" value="0">'+settings.topOptionText+'</option>').appendTo($container);
}//createFirstOption()

Within the function createSelect() use instead of

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createOption($('<li>'+settings.topOptionText+'</li>'), $select);
    }

the code

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createFirstOption($select);
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant