Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Coldfusion - showing initial value in radio button selection on form

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
ServalStudios
Asked:
ServalStudios
  • 3
  • 3
1 Solution
 
erikTsomikSystem Architect, CF programmer Commented:
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
 
ServalStudiosAuthor Commented:
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
 
erikTsomikSystem Architect, CF programmer Commented:
what is the value that get store in region (1, yes , no and so on )
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ServalStudiosAuthor Commented:
so if it is a value like "house" do I put eq "house" or?
0
 
erikTsomikSystem Architect, CF programmer Commented:
<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
 
dgrafxCommented:
<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
 
ServalStudiosAuthor Commented:
Thank you.. works great
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now