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 August 2nd, 2003, 12:20 AM
Igormed Igormed is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 Igormed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Radio buttons... getting desasperate

Please help, I just don't come out.....

On my index page I have radio buttons coming from database:

<TD>
<CFINPUT name="#QuestionID#" TYPE="Radio" value="#AnswerID#" checked="no"> #Answer#
</TD>

When I want to insert the database I'm getting errors.....
I was trying something like this but of course it doesn't work
because name of the field is a dynamically generated number (QuestionID)
<CFQUERY DATASOURCE="#DS#" NAME="insert">
Insert INTO tblEnquete
(
QuestionID,
AnswerID
)
VALUES
(
#QuestionID#,
#AnswerID#
)
</CFQUERY>

Someone knows? Thanks a lot in advance!! ! ! !

test page is: URL

Reply With Quote
  #2  
Old August 2nd, 2003, 03:51 AM
DeepDown DeepDown is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Netherlands
Posts: 99 DeepDown User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 1 m 8 sec
Reputation Power: 10
You could try to debug your query to actually see what the values are that are being inserted in the database.

i.e.:

Quote:
<!--- <CFQUERY DATASOURCE="#DS#" NAME="insert"> --->
<cfoutput>
Insert INTO tblEnquete
(
QuestionID,
AnswerID
)
VALUES
(
#QuestionID#,
#AnswerID#
)
<BR></cfoutput>
<!--- </CFQUERY> --->


This may get you a step further.
__________________
** Don't expect me to code your needs, but if I am able to help, I'm willing. Shout, grab and use the hand!
** Man can no more own the land we walk upon, as they can lay claim on the air that we breath
** DeepDown I'm addicted to structures.... ohw and music
** Almost forgot I had an account here [*o*]

Last edited by DeepDown : August 2nd, 2003 at 03:56 AM.

Reply With Quote
  #3  
Old August 2nd, 2003, 04:26 AM
Igormed Igormed is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 Igormed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi DeepDown,
thanks... but it doesn't work:

the problem is that the field name

#QuestionID# is dynamically generated

so, once is this 34 next time 22... and so on....

and the column name in the db is QuestionID. So I should have
something like: insert VALUE #QuestionID# .... but the name of the field is 34 or 22 .... and not #QuestionID#.....

but I don't know the name of the field.... because it is every time different.....

Reply With Quote
  #4  
Old August 2nd, 2003, 05:02 AM
DeepDown DeepDown is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Netherlands
Posts: 99 DeepDown User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 1 m 8 sec
Reputation Power: 10
I assume that after the post, you don't know what the names of the formfields are that you have submitted?

In that case:
Use the #FORM.FIELDNAMES# collection in the page you post your form-data to, in order to get the names of the fields you have actually submitted.

i.e.:

<CFOUTPUT>
<CFLOOP LIST="#FORM.FIELDNAMES#" index="FRMFIELD">
Fieldname and -value:<BR>
#FRMFIELD#: #EVALUATE(FRMFIELD)#<BR>
</CFLOOP>
</CFOUTPUT>

Reply With Quote
  #5  
Old August 4th, 2003, 12:11 AM
Igormed Igormed is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 Igormed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes! It works!
Than you very much!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Radio buttons... getting desasperate

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