944,141 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 2879
  • ASP RSS
Mar 21st, 2007
0

Using two dropdown forms in an ASP page

Expand Post »
I'm having a terrible problem using two drop-down forms in the same asp page. No matter what, the values for the second form are not passed to the SQL database. I've confirmed this by commenting out the first form and then the second form works fine. I'm sure it is something foolish I'm missing but can anyone help?

ASP Syntax (Toggle Plain Text)
  1. ' ChassisID Dropdown Menu
  2. Dim strChassisbuildSQL
  3. Dim rschassisbuilddata
  4. Dim strChassisMatchSQL
  5. Dim rschassismatchdata
  6.  
  7. WriteLine "<tr><td>ChassisID:</td>"
  8. WriteLine "<td><form><select name='dbtChassisID'>"
  9. strChassisbuildSQL = "SELECT ChassisID, Nickname FROM Chassis ORDER BY Nickname"
  10. Set rsChassisbuildData = cnDB.Execute(strChassisbuildSQL)
  11.  
  12. If strChassisID = "" then
  13. Writeline "<option value=''></option>"
  14. Else
  15. Writeline strchassisID
  16. strChassisMatchSQL = "Select Nickname from Chassis where ChassisID = " & strChassisID
  17. Set rsChassisMatchData = cnDB.Execute(strChassisMatchSQL)
  18. Writeline "<option value='" & strChassisID & "'>" & rsChassisMatchData("Nickname") & "</option>"
  19. rschassismatchdata.close
  20. end if
  21.  
  22. Do until rschassisbuilddata.EOF
  23. Writeline "<option value='" & rschassisbuilddata("ChassisID") & "'>" & rschassisbuilddata("Nickname") & "</option>"
  24. rschassisbuilddata.MoveNext
  25. Loop
  26. rschassisbuilddata.close
  27. WriteLine "</select></form></td></tr>"
  28. ' END CHASSISID DROPDOWN MENU
  29.  
  30. WriteLine "<tr><td>Bay:</td>"
  31. WriteLine "<td><input type=text size=40 " _
  32. & "maxlength=40 name=dbtBay value=" _
  33. & DQ & strBay & DQ & "></td></tr>"
  34.  
  35. ' BEGIN MODULE DROPDOWN MENU
  36. Dim strModulebuildSQL
  37. Dim rsModulebuilddata
  38. Dim strModuleMatchSQL
  39. Dim rsModuleMatchData
  40.  
  41. WriteLine "<tr><td>ModuleID:</td>"
  42. WriteLine "<td><form><select name='dbtNickName'>" 'Start Form and Assign value dbtNickName
  43. strModuleBuildSQL = "SELECT ModuleNameID, ModuleNickName FROM ModuleName ORDER BY ModuleNickName" ' SQL string to poll ModuleName table for available Modules
  44. Set rsModuleBuildData = cnDB.Execute(strModuleBuildSQL) ' Set SQL string
  45. If strNickName = "" then ' If there is no existing value for the module name, leave a blank option at top
  46. Writeline "<option value=''></option>"
  47. Else
  48. ' Writeline strNickName
  49. strModuleMatchSQL = "Select ModuleNickname, ModuleNameID from ModuleName where ModuleNameID = " & strNickName
  50. Set rsModuleMatchData = cnDB.Execute(strModuleMatchSQL)
  51. Writeline "<option value='" & strNickName & "'>" & rsModuleMatchData("ModuleNickName") & "</option>"
  52. rsModuleMatchData.close
  53. end if
  54.  
  55. Do until rsModuleBuildData.EOF
  56. Writeline "<option value='" & rsModuleBuildData("ModuleNameID") & "'>" & rsModuleBuildData("ModuleNickname") & "</option>"
  57. rsModuleBuildData.MoveNext
  58. Loop
  59. rsModuleBuildData.close
  60. WriteLine "</select></form></td></tr>"
  61. ' END MODULE DROPDOWN MENU
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pkkell0 is offline Offline
1 posts
since Mar 2007
Mar 26th, 2007
0

Re: Using two dropdown forms in an ASP page

You have 2 <form> elements in the single page, did you define the action correctly?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
todaydvd is offline Offline
12 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: when to use session and cookies variables ?
Next Thread in ASP Forum Timeline: how to get network login user name





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC