I'm developing an ASP.NET MVC 5 web page with .NET Framework 4.5.1 and C#.
I have this code:
<input type="text" class="quantity"
name="Quantity"
id="Quantity"
onkeydown='return (window.event.keyCode >= 48 && window.event.keyCode <= 57) || window.event.keyCode == 8 || window.event.keyCode == 46'
required />
onkeydown
works fine to allow only numbers, backspace and delete keys, but I can't select the input text when I click on it my the mouse.
I haven't found any relative information about this on Internet. Any idea?