In a
JSP page there are two buttons - submit and cancel.
The first buton- submit is on a form named 'f' along with other input fields.
The second button is outside form 'f'.
This works fine so far.
Now I introduce third button - save. The save button needs to submit the form f and hence it needs to be in form 'f'.
If all three buttons are put in a row in form 'f' with cancel button in middle (user requirement), then cancel button is going to be in form 'f'.
For cancel action (hitting cancel button), I don't want to submit the form.
How can I keep cancel button in middle but preventing form f being submitted on cancel action?