I have three input fields on my form that I have successfully created and limited to three digits only. I then want to test them when changed that they are less than 255 and if not take the user back to that field to try again. The code below is working except for the $(this).select(); option. How can I quickly take the user back to the 'offending' field?
$(".colorField").change(function () {
if (parseInt($(this).val(), 10) > 255) {
$(this).select();
//display error message
$("#errmsg").html("Must be less than 255").show().fadeOut(2000);
}
});