tags:

views:

77

answers:

1

On a form I have two submit buttons:

<g:submitButton name="add" value="Add"/>
<g:submitButton name="addAnother" value="Add and Create Another"/>

I need to take slightly different action based on which button was used to submit the form. How to I get the name of the clicked button in my controller?

A: 

The name of the clicked button ends up in params:

if(params["addAnother"])
   doThis()
else
   doThat()
speshak