my question is
What events does an fire when its value is changed ?
I working on .net application asp.net mvc . I using input text numbers have up and down arrows
up increase and down decrease
which event fire when press on this two arrows
@Html.EditorFor(model => model.DirectManager, new { htmlAttributes = new { @class = "form-control", id = "txtDirectManagerId" } })
and this property as below
public class requester
{
public int DirectManager{get;set;}
}
so what event i will use when call jquery api
$(document).ready(function () {
$("#txtLineManagerId").autocomplete({
source: function (request, response) {
var searchText = $("#txtLineManagerId").val();
console.log("search text" + searchText)
$.ajax({
url: '@Url.Action("GetAllEmployeeBasedSearchText", "Resignation")',
data: { searchText: searchText },
method: "GET",
dataType: "json",
success: function (data) {
/* console.log("data is " + data);*/
response($.map(data, function (item) {
console.log("data is" + item.EmployeeID);
/*$('#LineManagerName').val(item.EmployeeName);*/
// $('#LineManagerName').html(item.EmployeeName);
return { label: item.EmployeeID, value: item.EmployeeID, employeeName: item.EmployeeName };
}))
}
});
},
position: { my: "right top", at: "right bottom" },
appendTo: '#searchContainer',
select: function (event, ui) {
// Update LineManagerName input with the selected Employee Name
$("#LineManagerName").val(ui.item.employeeName);
$("#selectedEmployeeName").val(ui.item.employeeName);
},
minLength: 4,
// appendTo: "#searchContainer"
});
});
Mohammad HussainPosted Aug 29, 2023, 7:54 AM
Abhishek YadavPosted Aug 29, 2023, 6:15 AM
inputevent: This event fires whenever the value of the input changes, regardless of how the change occurred (e.g., typing, pasting, increment/decrement buttons, etc.).changeevent: This event fires when the value of the input changes and the input loses focus. It does not immediately trigger when the value is changed dynamically, such as through JavaScript code.keydownevent: This event fires when a key is pressed down while the input is focused and its value is going to change.keyupevent: This event fires when a key is released after being pressed down while the input is focused and its value has changed.These events allow you to listen and respond to changes in the value of the input field in different scenarios.