Using two dropdown forms in an ASP page

Reply

Join Date: Mar 2007
Posts: 1
Reputation: pkkell0 is an unknown quantity at this point 
Solved Threads: 0
pkkell0 pkkell0 is offline Offline
Newbie Poster

Using two dropdown forms in an ASP page

 
0
  #1
Mar 21st, 2007
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?

  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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 12
Reputation: todaydvd is an unknown quantity at this point 
Solved Threads: 0
todaydvd todaydvd is offline Offline
Newbie Poster

Re: Using two dropdown forms in an ASP page

 
0
  #2
Mar 26th, 2007
You have 2 <form> elements in the single page, did you define the action correctly?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC