Я использую радиокнопку бритвы, но одна радиокнопка не выбирается
не отключен не знаю, почему не выбрали Single radio button
<div class = "col-md-4" style = "margin-right:-22%;">
<div class = "form-group">
<span> Single </span> @Html.RadioButton("Type", "1", new { onchange = "GetType(this.value)", @required = "required" })
</div>
</div>
<div class = "col-md-3">
<div class = "form-group">
<span> Multiple </span> @Html.RadioButton("Type", "2", new { onchange = "GetType(this.value)", @required = "required" })
</div>
</div>
Код JQuery
function GetType(Type)
{
if (Type == 1) {
$("#AllDepartments").hide();
$("#AllEmployees").show();
}
else if (Type == 2)
{
$("#AllEmployees").hide();
$("#AllDepartments").show();
}
}



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Ваше описание настолько низкое, но я думаю, что этот пример поможет понять, потому что переключатели должны иметь тот же имя, например:
<input type = "radio" name = "asdf">
<input type = "radio" name = "asdf">
<!doctype html>
<html lang = "en">
<head>
<meta charset = "utf-8">
<title>radio demo</title>
<style>
textarea {
height: 25px;
}
</style>
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<form>
<input type = "button" value = "Input Button">
<input type = "checkbox">
<input type = "file">
<input type = "hidden">
<input type = "image">
<input type = "password">
<input type = "radio" name = "asdf">
<input type = "radio" name = "asdf">
<input type = "reset">
<input type = "submit">
<input type = "text">
<select>
<option>Option</option>
</select>
<textarea></textarea>
<button>Button</button>
</form>
<div></div>
<script>
var input = $( "form input:radio" )
.wrap( "<span></span>" )
.parent()
.css({
background: "yellow",
border: "3px red solid"
});
$( "div" )
.text( "For this type jQuery found " + input.length + "." )
.css( "color", "red" );
// Prevent form submission
$( "form" ).submit(function( event ) {
event.preventDefault();
});
</script>
</body>
</html>
Уже указаны имя и идентификатор. "Тип" - это идентификатор и имя в моем синтаксисе.