Setting focus back to the current field on field change
Posted: 10 May 2016
I am trying to set focus back to the field that I am currently changing when click tab and the field fails validation.
When the form loads I set focus to $('.ScanBarcode-field').focus(); which works. When the user enters a value and hits "tab"
fd.field('ScanBarcode').change(function(){
//Validation rules fail
$('.ScanBarcode-field input').focus();
});
I am expecting the focus to return to the field that just changed. What am I missing?
Thanks
When the form loads I set focus to $('.ScanBarcode-field').focus(); which works. When the user enters a value and hits "tab"
fd.field('ScanBarcode').change(function(){
//Validation rules fail
$('.ScanBarcode-field input').focus();
});
I am expecting the focus to return to the field that just changed. What am I missing?
Thanks