Fix Undefined Returned from validationTargetFor

When a checkable element is passed in, the code in validationTargetFor tries to get the first element with the same name where validation is not ignored.  The problem here is that if validation is ignored for all matching elements with the same name, undefined is stored in element and returned.  The fix I have applied, first checks if there are elements matching the name, then tries to take the first element where validation is not ignored.  If that value is undefined, it then just returns the first element that matches the name regardless of whether validation is ignored.