7
Example: When I select the "Volvo" option, the modal appears...
<label>Recinto</label>
<select class="form-control" data-toggle="modal" data-target="#cria-recinto">
<option data-toggle="modal" data-target="#cria-recinto">O meu coliseu</option>
<option>volvo</option>
<option>A minha arena</option>
<option>a garagem da minha vizinha</option>
<option>Na esquina</option>
</select>
<script type="text/javascript">
$('select').change(function () {
if ($(this).val() == "volvo") {
$('#cria-recinto').modal('show');
}
});
</script>
Thank you so much for the help! The problem is that I want the modal to appear only after I have selected the option "Memory", understand? This example that you made the modal already appears when you click the selects (without having chosen an option). You could help me with this?
– André Albson
Thank you very much, Renan. It worked perfectly the way I wanted it :)
– André Albson
Thanks @Renan! I edited the answer. I was here trying to solve this, and had already tried both, but separately. :-)
– gustavox
I didn’t have to, don’t worry! Thanks! The important thing is to learn! But then I erase my tbm, so it doesn’t make any sense! Thanks! @Renan
– gustavox
That’s it! Thanks guys. See you around ;)
– André Albson