ZaZaKi, a web developer Between Manchester UK & Rotterdam NL. © 2015-2024.

jQuery input radio button


<!DOCTYPE html>

<html>
<head>
<title>Title of the document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.0/jquery.min.js">
</script>
<script>
$(document).ready(function() {
$('.radio_holder input:radio').on('change', function() {
$(this).closest('.radio_holder').find('input').not('input:radio').prop('disabled', true);
$(this).closest('p').find('input').prop('disabled', false);
$('.radio_holder input:radio').not(this).prop( "checked", false );
});
});
</script>
</head>

<body>
<form>
<div class="radio_holder">
<p><input type='radio'> <input disabled type="text"></p>

<p><input type='radio'> <input disabled type="text"></p>
<input type='radio'> <input disabled type="text">
<p></p>

<p><input type='radio'> <input disabled type="text"></p>
<input type='radio'> <input disabled type="text">
<p></p>

<p><input type='radio'> <input disabled type="text"></p>
<input type='radio'> <input disabled type="text">
<p></p>

<p><input type='radio'> <input disabled type="text"></p>
</div>
</form>
</body>
</html>