Enter Key Press behave like Submit in JSF

前端 未结 6 1578
鱼传尺愫
鱼传尺愫 2021-01-01 07:14

How to make Enter Key Press behave like Submit in JSF. It works with InputBoxes; but not with inputSecret boxes

6条回答
  •  梦谈多话
    2021-01-01 08:14

    I haven't seen this issue before. The chance is little that this behaviour is browser specific. Try in different kinds of browsers to exclude the one and other (IE6/7/8, FF, Safari, Chrome, etc). The chance is bigger that this is caused by a (poor) Javascript key event listener which incorrectly suppresses the enter key (for example a JS password validator which checks the entered characters).

    If still in vain, just add the following onkeypress to the h:form:

    
    

    You need to take textareas into account however. If you have them, then you need to copy all onkeypress events over the h:inputXXX elements expect of textareas yourself.

提交回复
热议问题