I have this checkBox in my view inside a form:
<g:checkBox name="myCheckbox" value="${false}" />
In my controller, I how do I know if it is checked or not?
I tried:
if(!params.myCheckbox)
// obviously not, because it will always be true
if(params.myCheckBox.checked)
// also dont work.
If you need to separately handle “checkbox is not checked” and “myCheckbox parameter is missing”, use: