ahmed salah

ahmed salah

  • 1.2k
  • 547
  • 66.6k

What events does an <input type="number" /> fire when its value is cha

Aug 28 2023 10:18 PM

my question is 

What events does an <input type="number" /> 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"
        });
  });

 


Answers (2)