5 Replies Latest reply on Jun 30, 2011 10:15 AM by erickson

    How to disable the enter key for a particular component

    Harish Ashwathnarayan Newbie

      Hi,

       

      On a page I have various components( a lot of button and links). Now, for a specific text field on this page, when the focus is on it, and when the user hits the enter key from the keyboard, the page gets refreshed/submitted.

      To handle this, we have used <rich:hotkey> tag to disable the enter key for that text field.

      [code]

      <rich:hotKey key="return" handler="return false;" />

      [/code]

       

      This did help us out, but there are other side effects for this, all the buttons on this page does not react for the enter key from the key board,though the rich:hotkey tag was specified only for that text field.

       

      We would like to disable the enter key only for a specific component and retain the enter key event for other components. Please help me on how to achieve this.

       

      Thanks,

      Harish.