3
How to make it select don’t allow that the "Leader" option is not duplicate, because in my business rule only one user can be a leader.
I thought the following:
Assuming I have 3 selects. If I select one of them as LEADER, and select another select as well LEADER, the javascript unselected the leading option of the first select and would leave selected only the Leader option of the second select.
Here is a simulation of the problem:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/js/bootstrap-select.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/css/bootstrap-select.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet" />
<select class="selectpicker" multiple>
<option value="1">Líder</option>
<option value="10">Para Conhecimentor</option>
<option value="11">Participante</option>
</select>
<br><br>
<select class="selectpicker" multiple>
<option value="1">Líder</option>
<option value="10">Para Conhecimentor</option>
<option value="11">Participante</option>
</select>
<br><br>
<select class="selectpicker" multiple>
<option value="1">Líder</option>
<option value="10">Para Conhecimentor</option>
<option value="11">Participante</option>
</select>
<br><br>
<select class="selectpicker" multiple>
<option value="1">Líder</option>
<option value="10">Para Conhecimentor</option>
<option value="11">Participante</option>
</select>
It’s not an answer to the question, but wouldn’t it be simpler to have a radio button to define the leader? Or three columns with names, being the first leader, select simple, and the other two select multiple for knowledge and participant.
– Bacco
It would be interesting also @Bacco, but in the documentation is not allowed radiobutton... I need to actually do with selects...
– André Albson
Is that so? http://answall.com/a/168517/32827
– BrTkCa
Very close to this @Lucascosta, but would only disable the value option "1". But it has helped a lot. Obigado.
– André Albson