Im trying to build a client side validation on my form and I'm wondering if theres a better way to do it than I imagined?
If a field is empty, then I want the parent container border to turn red, I could d this with a list of if statements...
// Complete Signup Validation
$("#signup-com-btn").click(function() {
var a = $("input.first_name").val();
var b = $("input.surname").val();
var c = $("input.email_addr").val();
var d = $("input.user_age").val();
var e = $("select.user_type").val();
var f = $(".profile_image").val();
if(a==''){
$(this).parent().css...
return false;
}
if(b==''){
$(this).parent().css...
return false;
}
...and so on...
});