Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
What events does an <input type="number" /> fire when its value is changed ?

I working on a .NET application ASP.NET MVC. I am using input text numbers that have up and down arrows.

up increase and down decrease

Which event fires when pressed on these two arrows?

C#
@Html.EditorFor(model => model.DirectManager, 
new { htmlAttributes = new { @class = "form-control", 
id = "txtDirectManagerId" } })


and this property is as below:

C#
public class requester
{
public int DirectManager{get;set;}
}

So what event will I use when calling jquery API?

What I have tried:

JavaScript
$(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"
        });
  });
Posted
Updated 13-Sep-23 7:46am
v3

1 solution

We've been discussing you:
It's a difficult one to describe ...
In this specific case, I think what annoys me (and probably others) is the way he is using us to keep his job, to get paid without actually learning anything: he posts code with the same problems over and over again. For example, every time he accesses a DB, he uses string concatenation and sometimes that is what causes his problem because a quote is present in the resulting SQL command. And we've told him over and over "don't do that, use parameterised queries" but he never learns, he isn't even trying to learn what he is paid for.
At a guess he grabs code from SO, throws it into his app, hits it with a hammer, and then posts here when it doesn't work. And he's been doing this for eight years! Laugh | :laugh:
No, he doesn't give back help - but that's because he doesn't know what he is doing ... and is probably quite proud of that.

So I stopped answering him because it's pointless doing so. But then I get reminded who it is because I deliberately don't make a habit of looking at the username to avoid any unconscious bias and answer him again.

What he's doing isn't - technically - abuse, hence we haven't tagged him in S&A. But it is annoying, it is frustrating, and I'd like to find a way to avoid him (and the other Help Vampires) because not getting answered by people who do know what they are doing would be good for his personal development: he might start to learn his job. Eventually. Either that or the sudden drop in productivity might be noticed by the company and he loses said job when they realise he's been ripping them off for at least eight years.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900