I would like to submit a form to an action on select box change (when an item is selected I need to update another select box and maybe other fields). The following code will submit the form to the controller/action defined on form element.
<g:select onchange="submit()"/>
How could I submit the form to a custom action ?
I think to put a hidden action submit on the page and trigger a click on it when selecting an item in the select box, but hopping there is a more elegant way.
The project use jquery, so the prototype library isn’t available.
Thanks a lot !
It is an unusal use-case to submit the whole form, just because one combo box is changed. Usually the following is sufficient submitting only the new value of the combo box.
However, if your REALLY want to have all other form fields to be submitted as well, I guess it would be the best, to have one dispatching action and your input box sets some hidden field before submitting to the standard form-action. Hidden submit buttons are scary 🙂