Im assembling a form validation script and Im pretty stuck on this:
$("*").live('click', function(){
if($(".validate").val()=="")
{
$(this).addClass("partError");
}
});
The first selector is attached to everything so that it is constantly updating, but when the function runs it won’t do anything.
I want this function to only select the input belonging to this class that are empty. But there can be a variable number of these elements belonging to the .validate class.
Why are you attaching it to everything?