Tobago Demo

Menu

Focus

After a page is loaded, some input element may have the focus, so the user can immediately begin typing information in the form. There is a ruleset to define which element have the focus, at first.

The boolean focus attribute of an input field sets the focus to the element explicitly.

The priority order is:

  • error (the first error element gets the focus)
  • auto (the element with the tobago tag attribute focus="true" gets the focus)
  • last (the element from the last request with same id gets the focus, not AJAX)
  • page (use the focusId attribute of the tc:page)
  • first (the first input element (without tabindex=-1) gets the focus, not AJAX)
© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.