Skip to main content
Participant
October 16, 2008
Question

Select output query from radiogroup selection

  • October 16, 2008
  • 1 reply
  • 248 views
noob...I have a few SQL queries defined as filters to select todays info, yest info, tomoro info, all info. My form works well using the output query ACStatus, ACStatus2Day, etc.
I put in a radiogroup like this: <input type="radio" name="RadioGroup1" value="4"> . I tried some cfif statements using variations of the RadioGroup1 variable but no luck (like <cfif #Form.RadioGroup1#=1><cfoutput query="ACStatus"><cfelseif #Form.RadioGroup2#=..... .
How can I set up my code to select a different query after a radio button is selected?
This topic has been closed for replies.

1 reply

Inspiring
October 16, 2008
> How can I set up my code to select a different query after a radio button is
> selected?

How immediately 'after'? You can't have ColdFusion run a query after
this event, until the client sends a new request to the server.
ColdFusion only runs on the server. Your form only runs on the client.
And they only talk to each other when a request is sent from the client
to the server and a response is sent back from the server to the client.

If that is happening. If the form is being submitted and the response
is not containing the desired results based on the value of this radio
control, then you need to tells more about what it is doing and how you
are trying to get it to do what you want.

If you are trying to get an immediate response where new information is
shown as soon as the radio button is selected, then you have a lot more
to do then is shown in your post. There are two ways to do this
'immediately'.

1) Return all possible data as JavaScript data in the response with the
form, then use basic DHTML affects to change the client display based on
the user's interaction with the radio control.

2) Incorporate AJAX and submit requests for new data to the server
behind the scenes and use DHTML affects to change the client display
based on the user's interaction with the radio control.