Good afternoon, I want to put a code that deactivates an input when I have another asset. At the moment I have this and it works perfectly:
<div class="col-sm-5 col-sm-offset-1">
<div class="form-group label-floating">
<input type="hidden" id='name' name='name' class="form-control" value="<?php echo $_SESSION['name']?>"/>
<div class="radio">
<label>
<input type="radio" name="bd" value="op1" checked id="op1" onClick="javascript:houseclean();">Op1
</label>
<label>
<input type="radio" name="bd" value="op2" id="op2" onClick="javascript:houseclean();">Op2
</label>
<label>
<input type="radio" name="bd" value="examenes" id="examenes" onClick="javascript:houseclean();">Op3
</label>
</div>
</div>
<div class="col-sm-5">
<div class="form-group label-floating">
<label class="control-label">Tema</label>
<select class="form-control" name="category" id="category">
<option disabled="" selected=""></option>
<?php
$query = mysql_query("select * from categories where active = 's' order by id ASC");
while($row = mysql_fetch_array($query)){ ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['category_name']." - ".substr($row['descripcion'], 0, 20)."..."; ?></option>
<?php } ?>
</select>
Bl. one Bl. two Bl. 3 Bl. 4
<script>
function houseclean() {
if ((document.getElementById('grupo1').checked == false) && (document.getElementById('grupo2').checked == false) && (document.getElementById('grupo3').checked == false) && (document.getElementById('grupo4').checked == false)) {
document.getElementById('category').removeAttribute('disabled');
} else {
category.value = "";
document.getElementById('category').setAttribute('disabled', 'disabled');
}
}
</script>
For now, when I activate any "group" checkbox, I disable the "category" input and vice versa. That's fine, but what I want to do is that when I give the third option of the radio input "exams" I can deactivate and delete the "group" and "category" checkboxes. I would also like the opposite, that if I do some check in "group" or put a subject in "category" I delete and deactivate the third radio option ...