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?
The name of the clicked button ends up in params:
if(params["addAnother"])
doThis()
else
doThat()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With