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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:26:01+00:00 2026-05-23T15:26:01+00:00

I am working with ASP.NET MVC 3 and jQuery 1.5. Somewhere in my code

  • 0

I am working with ASP.NET MVC 3 and jQuery 1.5.

Somewhere in my code I use jQuery to set the selected value of a dropdownbox like so:

$("#SelectedFilterOption").val(filterOption)

filterOption is the value of the option field, not the text. On my screen I see the right value as selected, however, when I look at the html, I do not see any option element with the selected attribute set. When I post these values to to my ASP.NET MVC 3 app, how do “they” know what value is selected?

Edit:
$("#SelectedFilterOption").val() does return the right value. Also I noticed that when I set the initial selected value from ASP.NET MVC, that element will get the selected attribute. The selecte dattribute stays on the field in the html, even when I manually select another option.

I will inspect this with firebug as well (in addition to chrome and IE9 tools).

  • 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-23T15:26:02+00:00Added an answer on May 23, 2026 at 3:26 pm

    It finds the index of the first item with that value.

    When it has the index, it uses <select>‘s .selectedIndex=targetIndexNumber property via DOM. Editing the html is not required. Some browsers do that themselves, others don’t bother.

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

Sidebar

Related Questions

Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
I'm working with an Asp.net MVC 3.0 application and use JQuery + JSON .
I currently write quite a bit of code in ASP.NET MVC and use jQuery
So I am working with ASP.Net MVC + jQuery autocomplete and I have a
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I'm working in ASP.NET MVC 1.0 using MvcContrib FluentHtml version 1.0. The following code
I'm working on a new ASP.NET MVC / JQuery app which will need to
i am working in asp.net mvc 3 web application which uses razor code. and
In my ASP.NET MVC 3 application I want to use Jquery's pagination plugin to
I have a website using ASP.NET MVC, everything was working fine, but I'd like

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.