How can I do this

Results 1 to 3 of 3

Thread: How can I do this

  1. #1
    Join Date
    Dec 1969

    Default How can I do this

    Ok I want to use a drop down menu to display names of sales people, when the name is selected the user is then taken to another page<BR><BR>Here is the code I am using on the page to select the name from the drop down menu, but how can I pass the salespersonsid to the next page so it can run an sql query against the salespersonsid?<BR><BR>&#060;%<BR>Dim objRS1, objDB1, vSQL1, sHTML1<BR>vRetval = request.cookies("SPID")<BR>if vRetVal &#060;&#062; "" then<BR>set objRS1 = Server.CreateObject("ADODB.Recordset")<BR> <BR>vSQL1 = "SELECT distinct (Prospects.SalesPersonID), SalesPerson.FirstName, SalesPerson.LastName FROM SalesPerson,prospects where SalesPerson.SalesPersonID = Prospects.SalesPersonID"<BR><BR> <BR>Set objDB1 = Server.CreateObject("ProcessData.clsProcessData")< BR>Set objRS1 = objDB.funcExecSQL(vSQL1, "MULTIVAL")<BR><BR>sHTML1 = "&#060;img src=/images/transparent.gif width=13&#062;&#060;form name=PSalesSelect method=get action=PSalesDetails.asp&#062;&#060;select name=PSalesMenu onChange=" & chr(34) & "submit();" & chr(34) & "&#062;&#060;option&#062;SELECT NAME&#060;/option&#062;"<BR><BR>do while not objRS1.EOF<BR>sHTML1 = sHTML1 + "&#060;option&#062;" & objRS1(1)& " " & objRS1(2)& "&#060;/option&#062;"<BR>objRS1.MoveNext<BR>loop<BR>sHTML1 = sHTML1 + "&#060;/select&#062;"<BR>Set objRS1 = nothing<BR>response.write sHTML1<BR>end if<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: How can I do this

    I think you need to get you a good book dude. Added the ID to the value attribute of the option tag. Then, when the page is submitted, the chosen ID will be sent to the next page.<BR><BR>do while not objRS1.EOF<BR>sHTML1 = sHTML1 + "&#060;option value=" & objRS1(0) & "&#062;" & objRS1(1)& " " & objRS1(2)& "&#060;/option&#062;"<BR>objRS1.MoveNext<BR>loop<BR>sHTML1 = sHTML1 + "&#060;/select&#062;"<BR>Set objRS1 = nothing<BR>response.write sHTML1<BR>end if

  3. #3
    Join Date
    Dec 1969

    Default It'll be in the querystring.

    If you are submitting the form when the drop-down list changes, it&#039;ll be in the querystring as Request.QueryString("PSalesMenu").<BR><BR>Also, you should NEVER NEVER NEVER use + for string concatenation. You should use & instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts