I cannot found the onfocusin() and onfocusout() events in the Input (BS5) control. In the help page of Input (Bootstrap 5), it show follows.
Standard events are supported. For this control, the onfocusin and onfocusout events will be useful. They are called when the user changes the focus to another field.
It is so funny. I added a BS4 control (input or button or even label) in the form, then the onfocusout() event on Input (BS5) is working. When I deleted the this control, it won’t work again.
Now the latest software update of Input (BS5) have the onfocusout and onfocusin events, but they are not working. When I changed back the control to Input (BS4), it work fine.
Input1.onfocus = function () {
console.log("onfocus");
};
Input1.onblur = function () {
console.log("onblur");
};
Input1.onkeydown = function () {
console.log("onkeydown");
};
BASIC
Function Input1_onfocus()
console.log("onfocus")
End Function
Function Input1_onblur()
console.log("onblur")
End Function
Function Input1_onkeydown()
console.log("onkeydown")
End Function
I have a funny findings with onfocus(), onfocusin(), onblur(), onfocusout() events on BS5 input control only, BS4 input control only and a form mixed with BS5 & BS4 input controls.
BS5 input control only: Only onfocus() & onblur() are working
BS4 input control only: Only onfocusin() & onfocusout() are working
A form mixed with both BS5 & BS4 input control
BS5 input control: All 4 events onfocus(), onfocusin(), onblur() & onfocusout() are working
BS4 input control: Only onfocusin() & onfocusout() are working
Should I use onfocus() & onblur() for BS5 conrtol rather than onfocusin() & onfocusout()?