Pull-Down Menu and Request.QueryString

Results 1 to 3 of 3

Thread: Pull-Down Menu and Request.QueryString

  1. #1
    Join Date
    Dec 1969

    Default Pull-Down Menu and Request.QueryString

    I have a pull-down menu with a finite number of options: 7 days, 30 days, 365 days or all days. <BR><BR>Based on the user&#039;s selection, the page will refresh, update a SQL SELECT query and also display the pull-down with the user&#039;s selection a the top of the pull-down and the remaining items in chronological order. <BR><BR>For example, initally the pull-down menu will default to:<BR>30 days at the top and selected<BR>followed by:<BR>7 days<BR>365 days <BR>all days<BR><BR>If the user were to select 7 days, the new page would show the pull-down menu with <BR>7 days at the top and selected<BR>followed by:<BR>30 days<BR>365 days <BR>all days<BR><BR>My question: right now, I am creating these pull-downs using a series of case statements (based on the Querystring passed in from the form&#039;s submit) and hardcoding the pull-down choices in each case. It works but I&#039;m wondering if there is a more efficient way to do this (e.g. via an array)?<BR><BR>Regards,<BR>Mitchell<BR>

  2. #2
    Join Date
    Dec 1969

    Default can you paste your code..


  3. #3
    Join Date
    Dec 1969

    Default RE: Pull-Down Menu and Request.QueryString

    Why do you care which one is "on top"????<BR><BR>Why not *always* put them in numerical order and then just pre-select the one that matches prior value?<BR><BR>I can&#039;t see the advantage to your mechanism.<BR><BR>Yes, you *could* do it your way with an array. Shrug.<BR><BR>&#060;%<BR>opts = Array("7 Days","30 Days","365 Days","All Days")<BR><BR>priorSel = ... &#039; get prior selection from form or db<BR><BR>...<BR>Response.Write "&#060;SELECT ...&#062;"<BR>Response.Write "&#060;OPTION&#062;" & priorSel<BR>For i = 0 To UBound(opts)<BR>&nbsp; &nbsp; If opts(i) &#060;&#062; priorSel Then Response.Write "&#060;OPTION&#062;" & opts(i)<BR>Next<BR>...<BR>%&#062;<BR><BR>

Posting Permissions

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