Please help me solve this problem. In this project I want to do something when you select a value, I disable text input. I want this work to be done dynamically. Language technology project is: ASP.Net MVC 5. Photo is below:

Help me please.
Please help me solve this problem. In this project I want to do something when you select a value, I disable text input. I want this work to be done dynamically. Language technology project is: ASP.Net MVC 5. Photo is below:

Help me please.
@Html.TextBoxFor(m => m.Gender, new { @placeholder = "جنسیت", @class = "gender" ,onchange="myFunction()"})
@Html.TextBoxFor(m => m.NV, new { @placeholder = "انتخاب نظام وظیفه", @class = "NezamVazifeh" })
<script>
function myFunction(){
var g= $("#Gender").val();
if(g=="fmale")
$("#NV" ).prop( "disabled", true );
}
</script>
or use
function myFunction(){
var g= $("#Gender").val();
if(g=="fmale")
document.getElementById("NV").disabled = true;
}