Open ScottBaxter1 opened 10 years ago
I've managed to do this..
I've just altered the addFieldClass function, with the following:
addFieldClass: function(){
this.removeFieldClass();
if(!this.validationFailed){
if(this.displayMessageWhenEmpty || this.element.value != ''){
if(this.element.className.indexOf(this.validFieldClass) == -1) this.element.className += ' ' + this.validFieldClass;
}
}else{
if(this.element.className.indexOf(this.invalidFieldClass) == -1) this.element.className += ' ' + this.invalidFieldClass;
//Set Focus On In-Valid Elements
var id = this.element.id;
document.getElementById(id).focus();
}
},
Hi Guys,
If validaiton fails, is it possible for it to focus on the failed input?
Hope this makes sense.