|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
You could try to debug your query to actually see what the values are that are being inserted in the database.
i.e.: Quote:
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. |
|
#3
|
|||
|
|||
|
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..... |
|
#4
|
|||
|
|||
|
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> |
|
#5
|
|||
|
|||
|
Yes! It works!
Than you very much! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Radio buttons... getting desasperate |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|