Reputation: 29
What I have is a simple form.My problem is that I have validated it through Javascript on click of Submit button.What if I want to validate as soon as the user presses TAB key and goes to next field without filling in the first?I have called the Javascript function on OnFocusOut event of textbox but it disables all my other links on the page(If I don't want to remain on that page and navigate to some other).Kindly help....
Upvotes: 0
Views: 4390
Reputation: 1175
$(document).ready(function(){
$("#txtName").focusout(function(){
if($("#txtName").val()=="")
{
alert("enter text");
}
});
});
Upvotes: 1