I have this on the frontend:
<input type="radio" name="adminArg1" value="brief" checked="true">
Brief information
</input>
I have this on the backend:
String adminArg1 = params.adminArg1
String adminArg2 = params.adminArg2
I want to assign ‘brief’ to adminArg1, but also ‘null’ to adminArg2, whenever I click on the radio.
Is that possible?
You could either use Groovy’s multiple assignment to assign the values:
or if you’re using some kind of validating class (e.g., Command Object or Domain Class) you can override the Groovy setters: