I would like to know how I do to avoid generating an alert for each value entered in an input field with the keyup event, I only wish that the alert be executed once if the validation fails, but with this code if in the input I press x number of keys, that x number of times the alert appears.
thanks.
$(function(){
$('#nu_useful_width_max').keyup(function(){
setTimeout(function(){
var min = parseFloat(document.getElementById('nu_useful_width_min').value);
var max = parseFloat(document.getElementById('nu_useful_width_max').value);
if(min>=max)
alert('El ancho útil minimo no puede ser mayor al ancho útil maximo, por favor corregir');
}, 1300);
return false;
});
});