1
I would like when the person chooses one of the select options to appear the form as the code says. And also that when a form appeared the other was with display None.
$(document).ready(function() {
document.getElementById('test').addEventListener('change', function () {
if (this.value == 2) {
var style = this.value == 2 ? 'block' : 'none';
document.getElementById('formContato').style.display = style;
}; else if (this.value == 3) {
var style = this.value == 3 ? 'block' : 'none'
document.getElementById('formRevenda').style.display = style;
}; else (this.value == 4){
var style = this.value == 4 ? 'block' : 'none';
document.getElementById('formCliente').style.display = style;
};
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="assunto c-form">
<label class="lado">
<select class="text" id="test">
<option id="trabalhe" value="1">Trabalhe conosco</option>
<option id="sugestoes" value="2">Sugestões/Reclamações</option>
<option id="revendas" value="3">Cadastro de Revendas</option>
<option id="clientes" value="4">Cadastro de clientes</option>
</select>
</label>
</div>
<form id="formContato" style="display: none;">
<input type="text">
</form>
<form id="formRevenda" style="display: none;">
<input type="text">
</form>
<form id="formCliente" style="display: none;">
<input type="text">
</form>