2
I have a div that stays hidden on the screen:
<div id="selectCity" name="selectCity"
class="form-group col-md-12" style="display: none;" >
<label for="cities">Para os usuários da cidade:</label>
<?php echo $this->formRow($form->get('cities')); ?>
</div>
When changing the radio group selection it should be visible. For this I use this code:
function handleClick(myRadio) {
if (myRadio.value.localeCompare("selecteduser") === 0) {
document.getElementsById("selectCity").style.display = "block";
} else {
document.getElementsById("selectCity").style.display = "none";
}
}
handlerClick is called, the check is done without major problems. The problem is the div style is not changed.
Can anyone tell me why?
One @franM question, can’t you use jQuery? I think it’s much easier to work.
– Pedro Camara Junior
It could be jQuery
– franM
I put in the answer I had misunderstood but already found a problem
– Hiago Souza
Good afternoon, don’t use irrelevant tags for the question, use tags about the problem and not about the project. I’m sure you’ll take my comment as a constructive criticism.
– Guilherme Nascimento