Hi,
There are some validations on my JavaScript code I prefer to do on input-text's "onchange";
The validation is ok, but when something is wrong I run an alert and should turn the focus for this.focus();
But, the this.focus() doesn't work and the validated control lost the focus;
Like
txtEmail.onchange = function(){
if(this.value == ""){
alert("Please, type the e-mail");
// the code below doesn't work;
this.focus();
}
}
Does anyone know how to make it happen?
Thank You
There are some validations on my JavaScript code I prefer to do on input-text's "onchange";
The validation is ok, but when something is wrong I run an alert and should turn the focus for this.focus();
But, the this.focus() doesn't work and the validated control lost the focus;
Like
txtEmail.onchange = function(){
if(this.value == ""){
alert("Please, type the e-mail");
// the code below doesn't work;
this.focus();
}
}
Does anyone know how to make it happen?
Thank You