I'm sure a lot of people have asked this, but here is the problem I'm having, and I'm not sure exactly how to solve it. It's probably something simple that I'm just missing conceptually, but hopefully you guys know the answer...
OK... I have a form, and in the form I have two commandButton components. One is "Back" and has its immediate attribute set to "true". The other button is "Continue", and its action attribute is set to call a method on a bean. Both work great if the user *clicks* on the respective buttons.
However, the problem is that if the user hits the *Enter* key, the form submits (expected), but it behaves as if the "Back" button was clicked. Is there a way to force the submit of a form to always do the same action of the "Continue" button (i.e. call the method on the bean)?
Thank you for the suggestions. Unfortunately I can't do Bauke's suggestion since the design is rather specific in its placement of the buttons.
I tried out ali's suggestion, and it seems to not work as expected. I made the continue button's id "submit", but it still triggers the "Back" commandButton.
So it looks like I'm down to trying Anu's suggestion, or some variant of it. Let me know if anyone has any other suggestions.
///eks [ December 20, 2006: Message edited by: evan k. stone ]
Joined: Oct 08, 2006
Try putting the back button in a separate h:form.
Joined: Mar 18, 2004
Here i have used "onklick" instead of "onclick" because it is not allowing me to use that one. so just replace it