views:

501

answers:

2

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?

+1  A: 

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>
Dick Chesterwood
+1  A: 

Yep, onChange is the correct way to do it. I can't think of a better way.

leebutts
Thanks Lee! Good to know, I had a nagging feeling I was missing something!
Dick Chesterwood