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 8154799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:28:21+00:00 2026-06-06T16:28:21+00:00

I was hoping someone could shed some light on a very odd behavior I’ve

  • 0

I was hoping someone could shed some light on a very odd behavior I’ve encountered. I have a simple select box (single value drop-down) that has a default selected value set on page load. The odd behavior is that if the user changes the value of the select box, it appears both values (the default value and the new selected value) are being sent on postback?!

<select name="selectBox">
    <option value="1" selected>Item 1</option>
    <option value="2">Item 2</option>
    <option value="3">Item 3</option>
</select>

So, if a user selects item 2, on post I’m receiving a value like, "1,2". Obviously, I’d expect just to receive a value of "2". If I debug in firebug, when I select an option, the value being displayed in firebug is the single, selected value as expected. It seems so simple, am I blind? I am using MVC as the framework, if that makes any difference. Your help is greatly appreciated.

  • 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-06-06T16:28:24+00:00Added an answer on June 6, 2026 at 4:28 pm

    Add a name attribute to your select element.

    The name attribute is used to reference form data after it’s
    submitted, and to reference the data using JavaScript on the client
    side. Unlike the id attribute, which must be given a unique value each
    time it’s applied to a new form control, a name attribute with a given
    value may be applied to numerous form controls (although in practice
    this approach is only ever seen in use with radio input buttons).
    Note that only form elements which have a name attribute will have their values passed through to the page or script specified in the
    form’s action attribute.

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

Sidebar

Related Questions

Hoping someone can shed some light on this. I have a PHP program which
first post here, hoping someone could perhaps shed some light on an issue I've
I was hoping someone could shed some light on this for me... I can't
I'm hoping someone could shed some light on how I would do this in
I'm having some strange issues with Matches, hoping someone could shed some light. According
I encountered some weird behaviour today and I was hoping someone could shed some
We have an interesting problem that I was hoping someone could help to shed
I was hoping that someone can shed some light on why I am getting
I was hoping someone can shed some light on this for me. I do
I have been debugging this for awhile now, and I'm hoping someone could shed

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.