Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Coldfusion - showing initial value in radio button selection on form

Posted on 2008-10-03
7
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 22636086
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
ID: 22636406
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
ID: 22636435
what is the value that get store in region (1, yes , no and so on )
0
Stressed Out?

Watch some penguins on the livecam!

 
LVL 1

Author Comment

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

Accepted Solution

by:
erikTsomik earned 1000 total points
ID: 22636774
<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 25

Expert Comment

by:dgrafx
ID: 22636932
<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
ID: 31502852
Thank you.. works great
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

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…
Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

705 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