ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 23rd, 2011, 08:43 PM
Vijayvijay77 Vijayvijay77 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 2 Vijayvijay77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 39 sec
Reputation Power: 0
Homework - Error Formating Radio Button

Hi,
I have to show the user a form which he has submitted earlier. All the data has been saved to the database. The purpose of the form is to allow the authenticated user to edit the form fields.
One of the form field is a radio button, And I could input the values from the database to the form, shown to the user. The only error the form page has it doesn't properly format the radio buttons.
The code is as follows:
<input type = "radio" class = "button" value = "1"
<Cfif x = 1>Checked</CFif>YES
<input type = "radio" class = "button" value = "0"
<Cfif x = 0>Checked</CFif>NO

The code is inputing the values correctly from the database, the problem is:

() ()NO

Consider () as radio buttons, I am getting the form in the above format if the value of the variable is NO.
If it is YES, then it shows up as:

()YES ()

These is the error. Please help me with some valuable suggestions.
Vijayvijay77.

Reply With Quote
  #2  
Old March 25th, 2011, 09:19 AM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
Are you actually ending the <input> tag? Note the ending tag brackets I added:

Code:
<input type = "radio" class = "button" value = "1" 
<Cfif x = 1>Checked</CFif> />YES
<input type = "radio" class = "button" value = "0" 
<Cfif x = 0>Checked</CFif> />NO

Reply With Quote
  #3  
Old March 28th, 2011, 08:20 AM
BowlerDo0d BowlerDo0d is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 27 BowlerDo0d User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 41 m 25 sec
Reputation Power: 0
May also want to group them with a name field so the user cannot check them both.


Code:
<input type = "radio" class = "button" name = "myRadios" value = "1" 
<Cfif x = 1>Checked</CFif> />YES
<input type = "radio" class = "button" name = "myRadios" value = "0" 
<Cfif x = 0>Checked</CFif> />NO

Reply With Quote
  #4  
Old March 28th, 2011, 01:04 PM
Vijayvijay77 Vijayvijay77 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 2 Vijayvijay77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 39 sec
Reputation Power: 0
I got the solution to it,
If I was using the <cfif> tag inside the Input tag, it was selecting me the right yes/no option but the problem of formating still existed.
But, I used the following format:
<cfif> conditions
<cfinput> tag
<cfelse>
<cfinput> tag

These format gave me the right result with right format!!
And if anyone is stuck with the same problem let me know.

Thanks so much for the replies, I really appreciate the help.
Thank You,
Vijayvijay77.

Reply With Quote
  #5  
Old March 30th, 2011, 02:52 PM
Master__Chief Master__Chief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 339 Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level)Master__Chief User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 6 h 11 m 41 sec
Reputation Power: 46
Code:
<Cfif x eq 1>


not

Code:
<Cfif x = 1>


__________________
ColdFusion Ninja 4 Hire!

Reply With Quote
  #6  
Old March 30th, 2011, 04:10 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
Good call, though if you are on CF 9 (and maybe 8, I can't remember) you can also use the more common operators like ==, ++, --, &&, ||, etc.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Homework - Error Formating Radio Button

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap