How do select go back to the initial state after "deselect"?

Asked

Viewed 213 times

0

2 answers

0

If I understand, in your case you have to go through all the options and uncheck one by one. Then just check the selected one. I hope I helped.

  • That’s right, but I can’t seem to do it..

0

See if that’s what you want:

<select class="selectpicker" id="funcao">
    <option title="Opção 1">Líder</option>
    <option title="Opção 2">Para Conhecimentor</option>
    <option title="Opção 3">Participante</option>
 </select>

Source

  • @Fraga, if you look at my example, after I select the option with value= "1", you will see that it disables these options in the other selects, but if the user unchecks this option, the selects (which had their option disabled) cannot go back to "normal"That is, rehabilitate them. Get it? I would need the select to return to its "home state"...

  • And the "initial state" would be?

  • The "initial state" refers to it showing again the option that was "hidden" in the other selects. In the simulation of the problem I posted, when the "Leader" option is selected, it removes/hides this option in the other selects. But if I uncheck the "Leader" option, the other selects remain hidden... Note the example: https://jsfiddle.net/andrealbson/o1xs3m8x/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.