I need to capture the keyup event in order to provide a direct check when the user enters input (the change event fires only when the input loses focus).
I'm having trouble getting a modified input value that evnt activated.
The code also works on a timer to prevent multiple calls when a user enters (only works every 500 ms).
I have several inputs with the class "priceinput" and attach to the keyup event of each of them as follows:
<script language="javascript" type="text/javascript">
var timer;
$(document).ready(function()
{
$(".priceinput").each(function()
{
$(this).keyup(function(e)
{
clearTimeout(timer);
timer = setTimeout(function()
{
var value = ???;
$.getJSON('/Validator/IsValidInput', { input: value },
function(response)
{
});
}, 500);
});
});
});
</script>
To get the input value of the sender, I tried $(this).val, this.val(), e.target.val()but no one works.
How to get sender input value?