I'm checkin a form for empty values via the following method
$("#reservationForm").find("input[type=email], input[type=tel], input[type=text]").filter(function(){
if($(this).val() == ""){
$(this).css("border","solid 1px red").after('Please fill in your '+this.id+'');
f.preventDefault();
}
Now i want to improve the usability and set the focus to the first empty field, but that's the problem. I tried all of the following, but everytime only the last empty field gets the focus
$(this).eq(0).focus();
$(this:first).focus();
$(this:first-child).focus();
How can i set the focus automatically to the first empty field?