Solved

Coldfusion - showing initial value in radio button selection on form

Posted on 2008-10-03
7
329 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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 250 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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