File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Two submit buttons. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Two submit buttons." Watch "Two submit buttons." New topic

Two submit buttons.

Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
Hi Friends,
This is Sham, iam working on a project, with similar framework as that of struts.
The problem that iam facing is that, i have two submit button one for moving back in an application flow and the other for moving forward. On hitting enter in the mid way of fill an application by default the back button is striked i want to strike the continue button by default.

Thank you in advance,

s penumudi
Ranch Hand

Joined: Nov 17, 2004
Posts: 113
I think in a form when one hit "enter", the first submit button gets invoked.

In your scenario, make your back button of type "button" instead of "submit" and onClick through javascript submit your form. By this when user clicks on back button your form will get submitted and if he hits "enter" forward submit button gets invoked.

hope this helps
[ May 23, 2005: Message edited by: s penumudi ]
subject: Two submit buttons.
jQuery in Action, 3rd edition