Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6149311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:25:52+00:00 2026-05-23T19:25:52+00:00

I have a drop down but i am unable to get the value of

  • 0

I have a drop down but i am unable to get the value of the selected item. If i use request.form(“PageSelect”) the value is 0 although i know my multidimensional array used to fill the list works.

 <select name="PageSelect" onchange="this.form.submit()" style="font-weight:bold;">
                            <option value="">[All]</option>                         
                    <%                    
                    Dim PageArray
                    Dim PageCount
                    Set c = Server.CreateObject("ADODB.Connection")
                    Set r = Server.CreateObject("ADODB.Recordset")
                    r.CursorLocation = adUseServer
                    c.open connectionstring
                    c.CursorLocation = adUseServer

                    SQL = "select * from a_page order by P_Description"

                    Set r = Server.CreateObject("ADODB.Recordset")
                    r.CursorLocation = adUseServer
                    r.Open SQL, c, adOpenForwardOnly, adLockReadOnly
                    If r.BOF or r.EOF Then
                       r.close()
                       Set r = Nothing
                    Else
                       PageArray = r.GetRows()
                       PageCount = UBound(PageArray, 2)
                       r.Close()
                       Set r = Nothing
                    End If
                    c.Close()
                    Set c = Nothing
                        for i = 0 to PageCount                        
                            if PageSelect = pageArray(0,i) then
                            %>                          
                                <option selected value="<%=pageArray(0,i) %>"><%=pageArray(1,i) %></option>
                            <%                  
                            else
                            %>
                                <option value="<%=pageArray(0,i) %>"><%=pageArray(1,i) %></option>
                            <% 
                            end if
                        next %>
                        </select>

above this code is another 2 select boxes for different items

<select id="PermissionID" name="PermissionID" onChange="this.form.submit()" style="font-weight:bold;">
                            <option value="0">[All Permissions]</option>
<%  obj_ADO.ClearParameters
    lng_RecSet1 = obj_ADO.GetFreeRecordset
    obj_ADO.Recordset "A_combo_Permissions_select", adCmdStoredProc, obj_Session.int_CommandTimeout, lng_RecSet1
    while obj_ADO.EOF(lng_RecSet1) = 0
        if obj_ADO.GetField(0, adValue, lng_RecSet1) = lng_PermissionID then
%>
                            <option selected value="<%=obj_ADO.GetField(0, adValue, lng_RecSet1)%>"><%=obj_ADO.GetField(1, adValue, lng_RecSet1)%></option>
<%      
        else
%>
                            <option value="<%=obj_ADO.GetField(0, adValue, lng_RecSet1)%>"><%=obj_ADO.GetField(1, adValue, lng_RecSet1)%></option>
<%
        end if
        obj_ADO.MoveNext lng_RecSet1
    wend
    obj_ADO.CloseRecordset lng_RecSet1
%>                      
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <select multiple size="10" name="ActionPermissionID" id="ActionPermissionID">
                            <option value="">[Add/Remove Permission]</option>
<%  obj_ADO.ClearParameters
    lng_RecSet1 = obj_ADO.GetFreeRecordset
    obj_ADO.Recordset "A_combo_Permissions_select", adCmdStoredProc, obj_Session.int_CommandTimeout, lng_RecSet1
    while obj_ADO.EOF(lng_RecSet1) = 0
        if not isarray(lng_ActionPermissionID) then
            if obj_ADO.GetField(0, adValue, lng_RecSet1) = lng_ActionPermissionID then
%>
                            <option selected value="<%=obj_ADO.GetField(0, adValue, lng_RecSet1)%>"><%=obj_ADO.GetField(1, adValue, lng_RecSet1)%></option>
<%      
            else
%>
                            <option value="<%=obj_ADO.GetField(0, adValue, lng_RecSet1)%>"><%=obj_ADO.GetField(1, adValue, lng_RecSet1)%></option>
<%
            end if
        else
%>
                            <option value="<%=obj_ADO.GetField(0, adValue, lng_RecSet1)%>"><%=obj_ADO.GetField(1, adValue, lng_RecSet1)%></option>
<%
        end if
        obj_ADO.MoveNext lng_RecSet1
    wend
    obj_ADO.CloseRecordset lng_RecSet1

%>                      
                        </select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:25:52+00:00Added an answer on May 23, 2026 at 7:25 pm

    Here was problem –

    if len(Request.Form("PageSelect"))>0 and isnumeric(Request.Form("PageSelect")) then 
        PageSelect = clng(Request.Form("PermissionID"))
    else
        PageSelect = 0
    end if
    

    changed to this –

    if len(Request.Form("PageSelect"))>0 and isnumeric(Request.Form("PageSelect")) then 
        PageSelect = clng(Request.Form("PageSelect"))
    else
        PageSelect = 0
    end if
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a drop down menu using JQuery but when I test it
I have this drop down menu.It stores month, Jan-Dec. User can choose any value
I have drop down list with 5 items. I want to send the selected
I have Drop Down List control and add dynamic add option into Dropdownlist but
I have following asp.net code but it gives error when I change dropdown selected
I have a drop down like this on my page: <p> <%= f.label :episode_id
I have a drop down menu and it works perfectly on everything except IE6
I have a drop-down list with known values. What I'm trying to do is
I have a drop down list where users can select a theme for the
I have a drop down box for each row inside a table <table> <tr>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.