2 Replies Latest reply on Jul 6, 2007 9:31 AM by jfrankman

    AutoTab in a text field

    jfrankman Novice

      Is there any way with a4j that you can move the focus to another text field once the first text field has been filled in? The classic example is a
      phone number that is split up into three text fields. When the user has finished typing in the area code, I want the cursor to automatically jump to the phone number prefix. There are numerous examples of doing this with
      JavaScript, but I could not find anything in a4j. Any thoughts would be
      appreciated.

      Thanks.

      James.

        • 1. Re: AutoTab in a text field
          Ilya Shaikovsky Master

          The only question is - do you really need to perform an ajax submit in conversion/validation purposes or you just need change focus without any server activities. If the answer is only client focus changing - I can't see why do you need a4j instead of simple JS.

          But if you really need to perform a request - you may use a4j:support pointed to onkeyup and after the request performed with success and the count of the symbols is that you need - you may use "focus" attribute to change the focus after request completed.

          • 2. Re: AutoTab in a text field
            jfrankman Novice

            I decided to go with plain old javascript. I was hoping that there would be a component in a4j or richfaces that had this sort of thing built in. Thanks for your help.