Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <label for='check_motoristaSobrio'>Motorista Sóbrio</label>
- <select class='form-control ativ1 ativ7 ativ4 ativ6' id="check_motoristaSobrio" name="check_motoristaSobrio">
- <option value="0">Selecione uma opção</option>
- <option value="Sim">Sim</option>
- <option value="Não">Não</option>
- </select>
- <div id="motoristaSobrioJustificativa"></div>
- <script type="text/javascript">
- var selectElem = document.getElementById('check_motoristaSobrio')
- var pElem = document.getElementById('motoristaSobrioJustificativa')
- // When a new <option> is selected
- selectElem.addEventListener('change', function() {
- var index = selectElem.selectedIndex;
- // Add that data to the <p>
- // pElem.innerHTML = 'selectedIndex: ' + index;
- if (index == 1)
- pElem.innerHTML = "<!-- Não tomou uma cachacinha hoje, então ta tudo certo -->";
- else if(index == 2)
- pElem.innerHTML = "<textarea name=\"check_justMotSobrio\" class=\"form-control\" rows=\"4\" placeholder=\"Justificativa\nPor qual motivo esses ser humano esta chapado?\"></textarea>";
- else pElem.innerHTML = "<!-- Nada -->";
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement