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?

'    ChassisID Dropdown Menu 
    Dim strChassisbuildSQL
    Dim rschassisbuilddata
    Dim strChassisMatchSQL
    Dim rschassismatchdata
    
    WriteLine "<tr><td>ChassisID:</td>"
    WriteLine "<td><form><select name='dbtChassisID'>"
    strChassisbuildSQL = "SELECT ChassisID, Nickname FROM Chassis ORDER BY Nickname"
    Set rsChassisbuildData = cnDB.Execute(strChassisbuildSQL)
    
    If strChassisID = "" then
        Writeline "<option value=''></option>"
    Else
        Writeline strchassisID
        strChassisMatchSQL = "Select Nickname from Chassis where ChassisID = " & strChassisID         
        Set rsChassisMatchData = cnDB.Execute(strChassisMatchSQL)
        Writeline "<option value='" & strChassisID & "'>" & rsChassisMatchData("Nickname") & "</option>"
        rschassismatchdata.close
    end if
            
    Do until rschassisbuilddata.EOF
            Writeline "<option value='" & rschassisbuilddata("ChassisID") & "'>" & rschassisbuilddata("Nickname") & "</option>"
            rschassisbuilddata.MoveNext
    Loop
    rschassisbuilddata.close
    WriteLine "</select></form></td></tr>"
' END CHASSISID DROPDOWN MENU  
      
    WriteLine "<tr><td>Bay:</td>"
    WriteLine "<td><input type=text size=40 " _
        & "maxlength=40 name=dbtBay value=" _
        & DQ & strBay & DQ & "></td></tr>"

'    BEGIN MODULE DROPDOWN MENU
    Dim strModulebuildSQL
    Dim rsModulebuilddata
    Dim strModuleMatchSQL
    Dim rsModuleMatchData
   
    WriteLine "<tr><td>ModuleID:</td>"
    WriteLine "<td><form><select name='dbtNickName'>" 'Start Form and Assign value dbtNickName
    strModuleBuildSQL = "SELECT ModuleNameID, ModuleNickName FROM ModuleName ORDER BY ModuleNickName" ' SQL string to poll ModuleName table for available Modules
    Set rsModuleBuildData = cnDB.Execute(strModuleBuildSQL) ' Set SQL string
    If strNickName = "" then ' If there is no existing value for the module name, leave a blank option at top
        Writeline "<option value=''></option>"
    Else
        ' Writeline strNickName 
        strModuleMatchSQL = "Select ModuleNickname, ModuleNameID from ModuleName where ModuleNameID = " & strNickName 
        Set rsModuleMatchData = cnDB.Execute(strModuleMatchSQL)
        Writeline "<option value='" & strNickName & "'>" & rsModuleMatchData("ModuleNickName") & "</option>"
        rsModuleMatchData.close
    end if
            
    Do until rsModuleBuildData.EOF
        Writeline "<option value='" & rsModuleBuildData("ModuleNameID") & "'>" & rsModuleBuildData("ModuleNickname") & "</option>"
        rsModuleBuildData.MoveNext
    Loop
    rsModuleBuildData.close
    WriteLine "</select></form></td></tr>"
'     END MODULE DROPDOWN MENU

You have 2 <form> elements in the single page, did you define the action correctly?

This article has been dead for over six months. Start a new discussion instead.