1
Eai, someone who knows jquery or js, how do I show a text field according to the option of a previous select? And if the user chooses no contact, how do I "hide" the input? Thank you !
$('input[name="WTaluno"]').hide();
$('input[name="Emailaluno"]').hide();
$('select[name="selectContato"]').on('change', function() {
alert('oi');
});
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<title>Help NTI</title>
</head>
<body>
<select id="selectContato" name="selectContato" class="form-control">
<option value="nao" name="nao">Selecione o contato</option>
<option value="optionWT" name="optionWT">Whatsapp / Telefone</option>
<option value="optionEmail" name="optionEmail">Email</option>
</select>
<input type="text" id="WTaluno" class="form-control" name="WTaluno" placeholder="Whatsapp / Telefone">
<input type="email" id="Emailaluno" class="form-control" name="Emailaluno" placeholder="Email">
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
</body>
</html>
Mass, thank you very much Leo ! Hug.
– Moises Abreu