Are you first timer at Why not join us and start exchange your knowledge with everyone. Register today!

jQuery - Flag if value is null

0 votes
added Feb 14 in jQuery by LC Marshal Second Warrant Officer (3,520 points)

var name = $('#name').val();

} else if ($.trim(name).length == 0) {
    alert("Your name can't be empty");
    return false;

} else if (name==null || name=="") {   
    alert("Your name can't be empty");  
    return false; 


Please log in or register to response this solution.