0

My Class:

package com

class Cafe {

    String cafeteriasurvey


    static constraints = {

        cafeteriasurvey nullable:true
    }

}

& form.gsp:

<%@ page import="com.Cafe" %>


<style>


h1{

text-align:center;

Color:#680000;

}

h2{

text-align:center;

font-weight:normal;

}

p{

font-style:Arial;

background-color:#b2b2b2;

}

.wrapper{

text-align:center;

}

.save{

text-align:center;

}

</style>

<h1>Cafeteria Survey</h1><br>


<h2 style="Color:#87212e">Caterer:Abhiruchi Caterers</h2><br>


<p>1.How would you rate for overall 'Breakfast' food items?</p><br>


<g:radioGroup name="cafeteriasurvey"


              values="['Muslim', 'Hindu', 'Christian', 'Buddhist']"


              labels="['Muslim', 'Hindu', 'Christian', 'Buddhist']"


              value="${cafeInstance?.cafeteriasurvey}">


    <p>${it.label}: ${it.radio}</p>


</g:radioGroup>

Any solutions how to save radio button.

Vinay Prajapati
  • 7,199
  • 9
  • 45
  • 86
  • This is near enough not even a grails question. What would you use in html to post an item ? A form ? a form that has a submit URL so radioButton SUBMIT button then . Please study some basic html stuff first before attempting a grails application. – V H Jun 13 '16 at 17:26

1 Answers1

0

call the name(params.cafeteriasurvey) in controller. then create new object . and call object.save() refer this http://docs.grails.org/3.1.1/ref/Tags/radioGroup.html

Varaj Vignesh
  • 341
  • 1
  • 7