Problem with radio buttons and enable disable other buttons
Posted: Mon Nov 23, 2020 4:10 pm
Hello, the problem is that I have 2 radio buttons and I configure them to simply activate or deactivate other form-type buttons that take us to another page, but never deactivate them. If I program it to hide them if it does so but not deactivate them.
Tested on crhome and firefox
Thanks for the help.
Code: Select all
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Página sin título</title>
<meta name="generator" content="DOELECTRIC">
<link href="css/index.css" rel="stylesheet">
<script src="js/jquery-1.12.4.min.js"></script>
<script>
$(document).ready(function()
{
$("#RadioButton1").change(function()
{
if ($('#RadioButton1').is(':checked'))
{
$('#Button2').prop('disabled', true);
}
});
$("#RadioButton1").trigger('change');
$("#RadioButton2").change(function()
{
if ($('#RadioButton2').is(':checked'))
{
$('#Button1').prop('disabled', true);
}
});
$("#RadioButton2").trigger('change');
});
</script>
</head>
<body>
<div id="wb_RadioButton1" style="position:absolute;left:17px;top:79px;width:36px;height:37px;z-index:0;">
<input type="radio" id="RadioButton1" name="boton_opcion" value="1" checked style="position:absolute;left:0;top:0;" title="BOTON OPCION"><label for="RadioButton1"></label></div>
<div id="wb_RadioButton2" style="position:absolute;left:17px;top:130px;width:36px;height:37px;z-index:1;">
<input type="radio" id="RadioButton2" name="boton_opcion" value="2" style="position:absolute;left:0;top:0;" title="BOTON OPCION"><label for="RadioButton2"></label></div>
<label for="" id="Label2" style="position:absolute;left:388px;top:18px;width:186px;height:20px;line-height:24px;z-index:2;">MODO DE FUNCIONAMIENTO</label>
<a id="Button1" href="./telerrup.html" onclick="window.location.href='./telerrup.html';return false;" style="position:absolute;left:55px;top:79px;width:198px;height:37px;z-index:3;">Telerruptor</a>
<a id="Button2" href="./telerrup.html" onclick="window.location.href='./telerrup.html';return false;" style="position:absolute;left:55px;top:130px;width:198px;height:37px;z-index:4;">Temporizador de escalera</a>
</body>
</html>
Tested on crhome and firefox
Thanks for the help.