Solved

populate the value of the radio button in coldfusion

Posted on 2007-11-19
2
1,871 Views
Last Modified: 2013-12-24
In myform I am retrieving the query from the dataabse and based on that values populating fields. How can i deal with radio buttons
My CF
 <cfif qryProgram.hidden eq 1>
             $('hiddenfield2').checked==true;
             <cfelse>
             $('hiddenfield2').checked==true;
             </cfif>

And the client is
  <label id="label" for="hiddenfield">Hide:(Y/N)</label>
            <label for="hiddenfield">Yes</label>
            <span class="hiddenfield1"><input type="radio" id="hiddenfield2" name="hiddenfield" value="1" >
            <label for="hiddenfield">No</label>
            <input type="radio" id="hiddenfield2" name="hiddenfield" value="0" checked></span>
            </div>
<cfif qryProgram.hidden eq 1>
             $('hiddenfield2').checked==true;
             <cfelse>
             $('hiddenfield2').checked==true;
             </cfif>
 
And the client is 
  <label id="label" for="hiddenfield">Hide:(Y/N)</label>
            <label for="hiddenfield">Yes</label>
            <span class="hiddenfield1"><input type="radio" id="hiddenfield2" name="hiddenfield" value="1" >
            <label for="hiddenfield">No</label>
            <input type="radio" id="hiddenfield2" name="hiddenfield" value="0" checked></span>
            </div>

Open in new window

0
Comment
Question by:erikTsomik
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 250 total points
ID: 20314973
you can place a cfif right in your radio tag to show "checked" or not basing the condition on your data record
<input type="radio" id="hiddenfield2" name="hiddenfield" value="1" <cfif qryProgram.hidden eq 1>checked</cfif> >

Open in new window

0
 
LVL 19

Author Comment

by:erikTsomik
ID: 20314985
The problem is her eI can not do that because I executing the the CF on the server usiong ajaxcfc
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question