I need to set a default value in a combo box and i cannot figure it out. Sorry I am new to Javascript (and web development). I am not really asking someone to write the code for me but point me in the right direction.
Function BuildTechnicianListDropDown(strSelectBoxName, intLockID)
Dim rst, cmd, cnn
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open strDSN, strDSNUserName, strDSNPassword
Set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = cnn
cmd.CommandText = "SPTechnicianListGet"
cmd.CommandType = adCmdStoredProc
Set rst = Server.CreateObject("ADODB.Recordset")
'Set rst = cmd.Execute
rst.Open cmd,,adOpenStatic,adLockReadOnly
Response.Write "<select name=" & Chr(34) & strSelectBoxName & Chr(34) & ">" & Chr(13)
Response.Write "<option value=" & Chr(34) & Chr(34) & ">" & "</option>" & Chr(13)
If not(isnull(intLockID)) Then
While not rst.eof
If rst("UserID") = intLockID Then
Response.Write "<option value=" & Chr(34) & rst("TechnicianID") & Chr(34) & "selected=selected>" & rst("LastName") & ", " & rst("FirstName") & "</option>" & Chr(13)
Else
Response.Write "<option value=" & Chr(34) & rst("TechnicianID") & Chr(34) & ">" & rst("LastName") & ", " & rst("FirstName") & "</option>" & Chr(13)
End If
rst.MoveNext
wend
Else
While not rst.eof
Response.Write "<option value=" & Chr(34) & rst("TechnicianID") & Chr(34) & ">" & rst("LastName") & ", " & rst("FirstName") & "</option>" & Chr(13)
rst.MoveNext
wend
End If
Response.Write "</select>" & Chr(13)
Set cmd = Nothing
Set rst = Nothing
cnn.Close
Set cnn = Nothing
End Function