0

I have jNiceIT plugin for Jquery. How can i disable the select dropdown styled with jNiceIt? It looks like this:

                <label for="titems">Select Box Control:</label>
                <div id="titems" tabindex="8" class="fmSelect" style="width: 40%; z-index: 1500;"><strong><span><cite>Value 1</cite></span></strong><ul style="display: none;"><li option="val_1" class="">Value 1</li><li option="val_2" class="">Value 2</li><li option="val_3" class="">Value 3</li><li option="val_4" class="">Value 4</li><li option="val_5">Value 5</li><li option="val_6">Value 6</li><li option="val_7">Value 7</li><li option="val_8">Value 8</li><li option="val_9">Value 9</li><li option="val_10">Value 10</li></ul></div>
                <select id="" name="items" tabindex="0" style="width: 100%; display: none;" class="fmZero">
                    <option value="val_1">Value 1</option>
                    <option value="val_2">Value 2</option>
                    <option value="val_3">Value 3</option>
                    <option value="val_4">Value 4</option>
                    <option value="val_5">Value 5</option>
                    <option value="val_6">Value 6</option>
                    <option value="val_7">Value 7</option>
                    <option value="val_8">Value 8</option>
                    <option value="val_9">Value 9</option>
                    <option value="val_10">Value 10</option>
                </select>

I've tried to set "disabled" on "true" for select but it does not work.

Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236

1 Answers1

0

Could you show the code where you're setting "disabled" to "true"?

I'm not familiar with jNiceIt but have you tried using something like this?

// To disable 
$('.fmZero').attr('disabled', 'disabled');

Did you check out this post about disabling elements?

This answer looks promising: https://stackoverflow.com/a/5891520/469643

Community
  • 1
  • 1
veeTrain
  • 2,915
  • 2
  • 26
  • 43
  • I use $("select[name='players']").attr('disabled', 'disabled') but it does not work – Tom Smykowski Apr 06 '12 at 20:52
  • If i try to use prop it tells i don't have this function. – Tom Smykowski Apr 06 '12 at 20:53
  • I don't see a name='players' in your markup in your question. Have you tried name='items'? To do a sanity check perhaps you might want to give it an id and do "#id_you_set" – veeTrain Apr 07 '12 at 13:06
  • I created a jsfiddle for you to see; I removed most of your mark-up in order to isolate and display what is going on. You also had the select box set to display:none in your question; not sure if that was intentional or not. Here is [the example](http://jsfiddle.net/aJFUT/) for you to experiment with. – veeTrain Apr 07 '12 at 13:28