I am using jQuery Chosen for 2 <select> elements. Each element contains the same values, and I use loops to place the selected values ββin the array and turn off each value that has already been placed in this array, and is not a selected parameter. In other words: I always turned off doppleganger.
I am trying to limit the number of selected values ββto the last cycle using the data attribute "maxpersons" and compare it with the number of selected values.
Unfortunately , this only works when the parameters have not been previously selected . If they are, someone else can choose another value. Which should not be allowed.
In addition, I would like to put the <p> next to the <select> element when the maximum is reached, and delete it automatically when the maximum is not yet reached.
Any help would be greatly appreciated! This is the JS script: http://jsfiddle.net/dq97z/28/
source share