Search code examples
grails

how get domain value form post to controller


this is the form for send data value

And this is the controller that value the post


Solution

  • Your input field is named ${surveyDetail.question} which is the value of the question attribute. It should be named question which you can then access via params.question.

    Input field:

    <input type="text" name="question" value="${surveyDetail.question}" />
    

    In controller:

    def value = params.question