I'm using a g:select (actually, a g:currencySelect) in my view.
I want a controller action to fire as soon as the user changes the value in the resulting select box.
How can I do this?
I'm using a g:select (actually, a g:currencySelect) in my view.
I want a controller action to fire as soon as the user changes the value in the resulting select box.
How can I do this?
I think I'm answering my own question here, but do let me know if there's a better way of doing this:
Use the onchange javascript function in the select tag:
<g:form controller="changeCurrency" action="changeCurrency">
<g:select onchange="submit()"/>
</g:form>
Yep, onChange is the correct way to do it. I can't think of a better way.