Is there a way to limit the max selected options in <select>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mihai Popescu
    New Member
    • Jul 2010
    • 4

    Is there a way to limit the max selected options in <select>

    Is there a way to select lets say max selected options from a <select> tag...
    for example
    I have a select with 150 options... but I want to select maximum 30...
    I've tried with js onclick and onchange for select but the event is trigged only when I release the mouse button
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    Just to clarify, you're trying to select more than one option at a time but no more than thirty options?

    Regards, Death

    Comment

    • Mihai Popescu
      New Member
      • Jul 2010
      • 4

      #3
      yes, something like this
      I can make a counter that counts every time I click on it... but some times the user can select with a click more than 30 options...
      now I check every time onChange if there are more than 30 then deselect the last of them...

      Comment

      Working...