Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:12:47+00:00 2026-06-12T09:12:47+00:00

I have 3 radio buttons which when selected, will run different query. I have

  • 0

I have 3 radio buttons which when selected, will run different query.
I have no idea how the if-else condition works for grails radio buttons as I’m completely new to grails..
this is my gsp page.

<label>Search id:</label><input type = "text" name = "searchid1">
<input type ="submit" name ="search" value ="Go!">

<br>

<g:radio name="myGroup" value="input1"/>

<g:radio name="myGroup" value="input2"/>

<g:radio name="myGroup" value="input3"/>

and the queries at the controller site..

String searchQ1 = "select * from alert_list where id = " + params.searchid1
def searchit1 = sql.rows(searchQ1)

String searchQ2 = "select * from Admin where id = " + params.searchid1
def searchit2 = sql.rows(searchQ2)

String searchQ3 = "select * from sec_user where id = " + params.searchid1
def searchit3 = sql.rows(searchQ3)

[searchit1: searchit1, searchit2: searchit2, searchit3: searchit3]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:12:47+00:00Added an answer on June 12, 2026 at 9:12 am

    the method you’re using for GSP is correct. However, in the controller you need to add in IF-ELSE statement.

    if (request.getParameter("myGroup").equals("input1"))
            {
    
            println("duck")
            redirect (action: radio)
    
            }
    
            if (request.getParameter("myGroup").equals("input2"))
            {
                println("chicken")
                redirect (action: abc)
    
            }
    

    Add the if-else condition in your controller and your problem will be fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which has radio buttons and the selected value is taken
I have following code which works for radio buttons but need to be changed
I have 3 radio buttons which hide/show some div's. The radio buttons are getting
I have a form which is rendered with radio buttons like so: <h2>How long
I have a group of three radio buttons. Depending on which radio button is
I have a web form that has 2 radio buttons, depending on which one
I have some radio buttons and I'd like to have different hidden divs show
Using jQuery UI I have two radio buttons, Approve/Reject, which I would like to
I have main activity which contains few radio buttons. Their is one button named
I've used php before and never run into this problem.... I have radio buttons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.