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

  • SEARCH
  • Home
  • 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 6158043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:53:17+00:00 2026-05-23T20:53:17+00:00

I have : select id=select1 runat=server> option>choose something /option> /select> and I have this

  • 0

I have : select id=”select1″ runat=”server”> option>choose something /option> /select>

and I have this javascript function

var op = document.getElementById("select1");

for (i = 0; i < array.length - 1; i++) {
    op.options[i] = new Option(arr[i]);  
}

now after this function, the select has more <option>.

Now When pressing on asp:button, I want to be able to read(on server side) the new selected value.

unfortunately when the server process the page ,all the selcet1 values that was given by the javascript function are gone and the server always see the orignal value of the select1 (“choose something”).

so, I can I read, on server side, the new options of the select1, that was generte by the javascript ?

Thanks for any help

Baaroz

  • 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-23T20:53:18+00:00Added an answer on May 23, 2026 at 8:53 pm

    You can loop the values by finding it using Request.Form, like

    foreach(string key in Request.Form) {
        Response.Write(key + ": " + Request.Form[key] + "<br />");
    }
    

    You might also just find it by using Request.Form["select1"];

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like that: <asp:ListView ID=lvList runat=server> <LayoutTemplate> <select id=select_list> <option value=-1> select
I have a Javascript function for my select box, but after I included runat=server
I have code below: <select id=testSelect> <option value=1>One</option> <option value=2>Two</option> </select> <asp:Button ID=btnTest runat=server
I have following manual code to open the URLs: <select type=text name=sel_veh id=Select1 runat=server
I have a javascript function below to move from select multiple box A which
I have the dropdownlist like this one : <asp:dropdownlist ID =ddlgender runat=server> <asp:ListItem Text=--Please
I have a this aspx-code: (sample) <asp:DropDownList runat=server ID=ddList1></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors
I have a dropdownlist with following options: <asp:DropDownList ID=ddlTaxStatus runat=server OnPreRender=ddlContainerStatus_PreRender> <asp:ListItem Text=--Select-- Value=-1></asp:ListItem>
I have an asp.net dropdown like this <asp:DropDownList width=95% ID=RessourceComposantes runat=server DataSourceID=Composantes DataTextField=Description DataValueField=ComposanteID>
i have a list: <asp:ListBox ID=lstProblems runat=server SelectionMode=Multiple></asp:ListBox> and i am populating it this

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.