jquery-ui-picklist: set maximum selected items -
I use the jquery plugin in my project and I want to set a limit for the items that the user chooses.
- How do I set a limit for the maximum number of items selected?
- How to disable a button on the control? - If maximum items are selected, I want to disable the "add" button
Thanks.
jquery-ui-picklist has multiple event hooks in which you can tie a function, I suppose That's the best option depending on the situation. Afterwards the ad is the best option so that after the limit is reached you can disable the add button. On-change counting events in both directions, if you are limiting one volume, then you should count after removing it afterwards.
Here is the list.
The button control is a regular HTML button control with a class of "addClass". You can change or modify this category or you can stop the defaults. I believe by default the Jquery plugin includes "Add" button along with the "Add all" button. If your amount of potential joints is more than your limit, then there is a need to be disabled in the situation before that. Just call the button with .hide (). And if the plus button multiplies again, show ()
- How to disable a button on the control? - If maximum items are selected, I want to disable the "add" button
Comments
Post a Comment