1
I have two selects, User Type and User. User Type has 2 option(Global and Individual). The idea is that when the client clicks on the Individual option, appear below the select User listing all registered Users. But if you click Global, nothing will appear. Help !
message
<div class="row">
<label class="md-h4" for="tipoMensagem">Tipo:</label>
<select name="message_type" class="col-md-3 bg--white-2" style="margin-left: 90px;" required>
<option name="" value=""></option>
<option name="global" value="global">Global</option>
<option name="individual" class="individual" value="individual">Individual</option>
</select>
</div>
<div class="row">
<label class="md-h4 m_top" for="nomeUsuario">Usuário:</label>
<select name="message_user" class="col-md-3 bg--white-2 m_top" style="margin-left: 50px;">
<option name=""></option>
<?php
foreach ($nome as $nomeUser) {
extract($nomeUser);
if(!empty($user_name) && $user_name != "" && strtoupper($user_name) != "NULL"){
echo "<option value='".($user_name)."'>{$user_name}</option>";
}
}
?>
</select>
</div>
js scripts.
$(document).ready(function(){
$('label[for="nomeUsuario"]').hide();
$('select[name="message_user"]').hide();
$('select[name="message_type"]').on('change', function(){
$('label[for="nomeUsuario"]').show();
$('select[name="message_user"]').show();
});});
Show, it worked perfectly, thank you very much !
– Moises Abreu