Skip to content Skip to sidebar Skip to footer

How Can One Avoid Selecting 2 Radio Buttons With The Same Value?

I have a form where I have two groups of radio buttons, names are different but values are shared, so I need to select a radio from the first group, once it's selected the radio fr

Solution 1:

import jQuery

<head>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
 </head>



  <script>
$( document ).ready(function() {

$('input[name=lang_or]').click(function(){

$('input[name=lang_tg]').prop("disabled",false);
$('input[name=lang_tg][value='+this.value).prop("disabled", "disabled");

});

});
</script>

Post a Comment for "How Can One Avoid Selecting 2 Radio Buttons With The Same Value?"