asp.net mvc jquery removing select list item

Posted by mazhar kaunain baig on Stack Overflow See other posts from Stack Overflow or by mazhar kaunain baig
Published on 2010-06-05T07:32:06Z Indexed on 2010/06/05 7:42 UTC
Read the original article Hit count: 630

Filed under:
|
|
 $('#remove').click(function() {
        var foo = [];
        $('#FeatureLists :selected').each(function(i, selected) {
            foo[i] = $(selected).text();
            alert(foo[i]);
            if (foo[i] != "Add" )
                return !$('#FeatureLists option:selected').remove();
            if (foo[i] != "Edit")
                return !$('#FeatureLists option:selected').remove();
        });

    });

i have six items in my select in which 4 of them are add,edit ,delete view, it is multiselect list, i don't want the user to remove the these 4 items , apart from that they can remove any item. how will i do that? it is not happening in the above code

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery