User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 361,950 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,663 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:

survey code not working

Join Date: Feb 2006
Posts: 2
Reputation: krazykrisi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
krazykrisi krazykrisi is offline Offline
Newbie Poster

survey code not working

  #1  
Apr 7th, 2008
Ok so I'm making a survey for a website and I have a series of questions where the user can rate it from a list of choices and I have these questions in a table in access and the rating options in a table. I want to have the questions display with the options in a dropdown box next to each question, I can't seem to get this to work. Here is my code:

  1. <!--- Get ratings --->
  2. <cfquery datasource="PFB" name="RatingsQ">
  3. SELECT *
  4. FROM Ratings, Questions
  5. ORDER BY RatingID, QuestionID
  6. </cfquery>
  7. <!--- Get genders --->
  8. <cfquery datasource="PFB" name="Gender">
  9. SELECT *
  10. FROM Gender
  11. ORDER BY ID
  12. </cfquery>
  13. <!--- Get states --->
  14. <cfquery datasource="PFB" name="State">
  15. SELECT *
  16. FROM State
  17. ORDER BY StateID
  18. </cfquery>
  19.  
  20. <!--- Get questions2 --->
  21. <cfquery datasource="PFB" name="Questions2">
  22. SELECT *
  23. FROM Questions2
  24. ORDER BY Question_ID
  25. </cfquery>
  26. <!----get ages----->
  27. <cfquery datasource="PFB" name="Age">
  28. SELECT ID, Age
  29. FROM Age
  30. ORDER BY ID
  31. </cfquery>
  32. <html>
  33. <body>
  34. <cfform action="insertnewreview.cfm">
  35. <table>
  36. <tr>
  37. <td>Age:</td>
  38. <td> <select name="AgeID">
  39. <cfoutput query="Age">
  40. <option value="#ID#">#Age#</option></cfoutput>
  41. </select>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td>
  46. Gender:
  47. </td>
  48. <td>
  49. <select name="Gender">
  50. <cfoutput query="Gender">
  51. <option value="#Gender#">#Gender#</option></cfoutput>
  52. </select>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td>
  57. State:
  58. </td>
  59. <td>
  60. <select name="State">
  61. <cfoutput query="State">
  62. <option value="#State#">#State#</option></cfoutput>
  63. </select>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td><cfoutput query="RatingsQ"><br><br>#Question#</td><td><select name="RatingID"><option value="#RatingID#">#Rating#</option>
  68. </select></cfoutput></td></tr>
  69.  
  70.  
  71. <tr>
  72. <td><cfoutput query="Questions2">#Q#:</cfoutput></td>
  73. <td>Answer: <textarea></textarea></td>
  74. </tr>
  75. <tr>
  76. <td colspan="2" align="center">
  77. <input type="submit" value="Insert"></td>
  78. </tr>
  79. </table>
  80. </cfform>
  81. </body>
  82. </html>
Last edited by peter_budo : Apr 7th, 2008 at 7:02 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 11:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC