Hi @Ahmed Abd El Aziz,
The answers to your three questions all have to do with the onchange event.
The onchange
event occurs when the value of an HTML element is changed.
@Html.EditorFor(model => model.DirectManager, new { htmlAttributes = new { onchange = "OnChangeEvent()", @class = "form-control", id = "txtDirectManagerId" } })
<script>
function OnChangeEvent() {
alert("value is changed");
}
</script>
<input type="number" onchange="myFunction()" />
<script>
function myFunction(){
alert("change");
}
</script>
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.