Solved

populate the value of the radio button in coldfusion

Posted on 2007-11-19
2
1,867 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
Comment Utility
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
Comment Utility
The problem is her eI can not do that because I executing the the CF on the server usiong ajaxcfc
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now