Solved

Coldfusion - showing initial value in radio button selection on form

Posted on 2008-10-03
7
323 Views
Last Modified: 2012-08-14
I have a Coldfusion form that includes a radio button.  When I want to update a record, I can pull in all the original values into every form except the radio button. Is there a way to set the value of the radio buttons to what is in the database?
0
Comment
Question by:ServalStudios
  • 3
  • 3
7 Comments
 
LVL 19

Expert Comment

by:erikTsomik
Comment Utility
sure it can be done
Once you get you query you just say this
<input type="radio" name="xxx" <cfif query.filedname eq 1>checked</cfif>>

0
 
LVL 1

Author Comment

by:ServalStudios
Comment Utility
I think we are close, but still not working..
my query is called "update" and my field is called "region", so I have

<cfif update.region eq 1>checked</cfif>

Would it be 1, or should it be something like text value in the field?
Thanks
0
 
LVL 19

Expert Comment

by:erikTsomik
Comment Utility
what is the value that get store in region (1, yes , no and so on )
0
Highfive Gives IT Their Time Back

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!

 
LVL 1

Author Comment

by:ServalStudios
Comment Utility
so if it is a value like "house" do I put eq "house" or?
0
 
LVL 19

Accepted Solution

by:
erikTsomik earned 250 total points
Comment Utility
<input type="radio" name="xxx" value="house"<cfif query.filedname eq "house">checked</cfif>>
<input type="radio" name="xxx" value="village"<cfif query.filedname eq "village">checked</cfif>>

0
 
LVL 24

Expert Comment

by:dgrafx
Comment Utility
<cfset fieldlist="car,house,boat,hole in the ground">
<cfloop list="#fieldlist#" index="ii">
      <input type="radio" name="xxx" value="#ii#"<cfif query.xxx is ii>checked</cfif>>#ii#<br>
</cfloop>
0
 
LVL 1

Author Closing Comment

by:ServalStudios
Comment Utility
Thank you.. works great
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

16 Experts available now in Live!

Get 1:1 Help Now