I have a div that is 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, checking is done without major problems. The problem is the style of the div is not changed.
Can someone tell me why?