Advertisement

10.29.2007 at 08:53AM PDT, ID: 22924603
[x]
Attachment Details

ColdFusion JavaScript Radio Buttons Issue With Syntax and Code Block

Asked by FSUKXAZ in Cold Fusion Markup Language, JavaScript

Tags: radio, javascript, buttons, coldfusion

I need to be able to loop through radio buttons and find the one that is selected and send that value into a query.  The code I have is below.  The JS function is something I just added, but I think it doesn't need to be a function. You can tinker with that, but leave most of the other code as is, because evrything else is working.   The question mark below is where the value should go into the code.  Thats where I'm stuck.
P.S.  I removed all HTML and formatting just to so you can read it easier.

<SCRIPT LANGUAGE="JavaScript">
      function GetRadioSelected()
      {
            var radiobuttons = document.getElementsByName("TheRegion");
            for (var x=0; x < radiobuttons.length; x++)
            {
                  if (radiobuttons[x].checked)
                  {
                        var RadioSelected = radiobuttons[x].value;
                  }
            }
      }
</SCRIPT>

<CFQUERY NAME="GetCategories" DATASOURCE="#request.datasource#">
      SELECT DISTINCT subcategory, Count(subcategory) AS SubcategoryCount
      FROM tblSAS
      WHERE reporttime > ###reportfrom###
      GROUP BY subcategory
</CFQUERY>

<FORM NAME="SAS" ACTION="SAS.cfm?GetResults" METHOD="post">
<CFOUTPUT>

      <SELECT NAME="EventCategory" ID="EventCategory" SIZE="10" MULTIPLE>
         <CFLOOP QUERY="GetCategories">
            <OPTION VALUE="#subcategory#">#subcategory#</OPTION>
         </CFLOOP>
      </SELECT>
      <BR>(hold ctrl key for multiple)
                        
      <CFLOOP QUERY="GetRegions">                                    
            <INPUT TYPE="Radio" NAME="TheRegion" VALUE="#Region#">
            <IMG SRC="../../../images/#imgfile#" WIDTH="15" HEIGHT="15"> #Region#<BR>
      </CFLOOP>
</CFOUTPUT>
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search">
</FORM>

<CFQUERY NAME="GetSelectedResults" DBTYPE="query">
      SELECT DISTINCT subcategory, subcategorycount
      FROM GetCategories
      WHERE subcategory IN (#PreserveSingleQuotes(TheResults)#)
            <CFIF isDefined("TheRegion")>
                  AND (SELECT Region FROM GetRegions WHERE Region = '?')
            </CFIF>
      GROUP BY subcategory, subcategorycount
</CFQUERY>Start Free Trial
[+][-]10.29.2007 at 09:08AM PDT, ID: 20170671

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 09:15AM PDT, ID: 20170738

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 09:29AM PDT, ID: 20170868

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 10:47AM PDT, ID: 20171566

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 10:58AM PDT, ID: 20171682

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 11:14AM PDT, ID: 20171827

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 11:37AM PDT, ID: 20172031

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 12:13PM PDT, ID: 20172347

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 01:27PM PDT, ID: 20173004

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, JavaScript
Tags: radio, javascript, buttons, coldfusion
Sign Up Now!
Solution Provided By: FSUKXAZ
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.29.2007 at 01:54PM PDT, ID: 20173205

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628