I've a reset button on my GSP to reset form fields to default values, so calling controller action upon clicking reset button and have to set params to blank and need to render same view.
I'm trying.. Controller Action:
def reset = {
request['name']= ''
request['street']= ''
render(view:'employee')
}
GSP:
<input type="text" id="name" value="${params.name}">
But it seems to be not working... how to achieve this?
Resolved by using redirect in controller action..so that all params and command validations will be out of request scope so no need to reset any fields.