Quesrystring and drop down

Results 1 to 5 of 5

Thread: Quesrystring and drop down

  1. #1
    Join Date
    Dec 1969
    Posts
    106

    Default Quesrystring and drop down

    For some reason, this code won&#039;t select the querystring in the drop downlist. Any ideas of what I am doing wrong? here is the code:<BR><BR> SQL="SELECT * FROM tblOptions"<BR> set rstemp=conntemp.execute(SQL)<BR> TypeID="TypeID"<BR> TypeName="TypeName"<BR> howmanyfields=rstemp.fields.count -1<BR> &#060;select name="TypeID" size="1"&#062;<BR> &#060;%do while not rstemp.eof %&#062; <BR> &#060;option value="&#060;%=rstemp("TypeID")%&#062;"&#060;%If rstemp("TypeID")=Request.querystring("TypeID") Then Response.Write "SELECTED" End If%&#062;&#062;&#060;%=rstemp("TypeName")%&#062;&# 060;/option&#062; <BR> &#060;%<BR> rstemp.movenext<BR> loop<BR> rstemp.close<BR> set rstemp=nothing<BR> %&#062;<BR> &#060;/select&#062;

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default Bill's mantra: DEBUG DEBUG DEBUG

    How about simply doing a <BR>&#060;%<BR>Response.Write "DEBUG: TypeID from querystring is " & Request("TypeID") & "&#060;HR&#062;"<BR>%&#062;<BR>before doing anything else? See if it really *DOES* match any of the values from your rsTemp.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    96,118

    Default And what's the point...

    ...of these two lines:<BR> TypeID="TypeID" <BR> TypeName="TypeName" <BR><BR>??? They don&#039;t seem to do anything useful, and in any case you don&#039;t use the variables after assigning to them.<BR><BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    1,316

    Default RE: Quesrystring and drop down

    Throw a Cstr around your rstemp<BR><BR>If Cstr(rstemp("TypeID"))=Request.querystring("TypeID ") Then Response.Write "SELECTED" End If%&#062;


  5. #5
    Join Date
    Dec 1969
    Posts
    106

    Default That worked!

    Thanks Jason!

Posting Permissions

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