3 Replies Latest reply: Oct 28, 2014 11:15 AM by Brian3.14 RSS

    Javascript to setFocus to nothing (as if none of the fields/buttons on a page have the focus)

    Brian3.14 Community Member

      Still trying to find a fully functional work around from my initial post here: mouseEnter/mouseExit event is triggering a screen jump ONLY when zoomed in?

       

      Thanks again to Radzmar for his thoughts.

       

      Part of the solution is clearing the focus using Javascript. --- as if the end-user clicked on dead space of the form so none of the fields, buttons, etc. has focus.

       

      Documentation states:

            xfa.host.setFocus() or xfa.host.setFocus(null) should do the trick.  But this only seems to work sporadically.  For example:

       

                1) Called from the mouseEnter event OF A BUTTON, either script WILL clear the focus from a traditional field object (text/numeric/etc.) --- but, ironically, NOT from a button.

                2) Exact same code in the exitEvent of a normal text field will NOT clear the focus. So while setFocus to an actual location WILL override the TAB order, setting to (null) or () doesn't do anything.

       

      Am I insane or is there really no way to just simply clear the form's focus?

       

      Thanks,

      BR