Focus Next Control : Focus Tab « Form Control « JavaScript DHTML






Focus Next Control

 
function focusNext(form, elemName, evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13) {
        form.elements[elemName].focus();
        return false;
    }
    return true;
}

onkeypress="return focusNext(this.form, 'name2', event)"

           
         
  








Related examples in the same category

1.Controlling the tab Index Property
2.Request focus for text field
3.Call blur method from text field
4.Focus lost event