This is on Grails!
This is a very basic thing which apperatnly I am failing to understand.
I have this in my index.gsp
<g:form name="testForm" url="[controller:'test',action:'index']">
<g:textField name="Input A" value="${Input1}"> </g:textField>
<g:textField name="Input B" value="${Input2}"> </g:textField>
</g:form>
I also have this in my TestController class:
class TestController {
def index = {
def Input1
def Input2
}
}
I want to get the two inputs that the user enters on the webpage and save them to the appropriate fields (Input1, Input2) on the controller.
How do I go about it?
thanks
You can write your form like this:
Note that in this case,
Then in the controller
With this, the values will be rendered properly (inside the returned model)