dropdownlist

If statement in javascript forms

Hello Im fairly new to javascript but have some experience in HTML. I am trying to create a form which allows me to select an option from the drop down menu, which further expands the form (showing new fields on the same page) depending on the option selected from the drop down menu. I figured I need some sort of if statement to achieve...

Saving Dropdown list selection with Entity Framework in ASP.NET MVC solution

Hi, I'm looking for advice on a decent pattern for dropdown list selection and persistence of the selection with POCO EF please. I have a list of IEnumerable<Country> in my view model where Country is a POCO loaded via EF. There is an Address property on the view model that takes the current or user selected value on it's Country prop...

postback on click for type ahead drop down

I have a type a head drop down list that I created. Clearly I had to turn the AutoPostBack to false because otherwise it would post back as the user was typing. But I want to poast back when use has made his selection. I don't wanna use a submit button or anything like that. Long story, just trust me it's not the solution for my situati...

ASP.NET and JQuery - Popup for dropdownlist selected value.

What I'm looking to do is popup an "are you sure" confirmation box if the newly selected value of a dropdownlist is a certain value before I submit the form. <select name="ListSearchType" id="ListSearchType"> <option value="C">Closed</option> <option value="O">Open</option> <option value="P">Pending</option> </select> So i...

Model View Presenter - how to show selected item in a Drop Down List?

I'm using Model-View-Presenter framework. When Loading a page, I'm having trouble setting the selected item that came from the Database. In view, I know I need: protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e) { presenter.DdlStatusSelectedIndexChanged(); // what should this pass? } Then in Presenter: publi...

Dropdown list in Rails tied to a different model

Hello, I have Category and a Product models. I want for each product to belong to a category. How would I have a drop down list so that you can select a category from the product pages? I've gotten everything to work with this: <%= collection_select(:category, :id, @categories, :id, :title, options ={:prompt => "-Select a category"}, ...

Check if Selection Changed in OnClick event

Note: The answer marked as the answer, answers the questions in the Title. However, my underlying problem, using type ahead dropdowns, is solved by moving to IE8. I have a drop down list that when I CLICK a NEW selection I want to cause a postback ("this.form.submit()") But only if the click on the dropdown list just changed the selecti...

How to display data from stored procedure in a drop down in Classic ASP ?

This is related to Classic ASP code. A page fetches data for a particular ProjectCode. There is a general text field which shows the Site-Location for selected Project-Code. I want to change it to drop down, so that a user can change the Site-Location from options available (fetched from DB) and then save it. Also, on page load the Sit...

Populate a DropDownList with AJAX

Hello, I have a very long list of items for a dropdownlist. As the list is very long, I would like to only show the items in the list if the user actually clicks on the dropdownlist to expand it. I found various tutorials on how to use AJAX with cascading dropdownlists but none explaining if it is possible to have just one dropdownlist ...

Display dropdown list with options in multiple columns

Is there a way to display an HTML dropdown list with options in multiple columns? I do not want multiple columns with one row of data, I want 3 rows of selectable options. Is this possible via either .NET or jQuery? ...

JS: How to reload the same webpage with param on dropdown change event?

I have a form in vehicles.php: <form name='vehicleform'> <select name='vehiclelist'> <option value=''>Select</option> <option value='bus'>Bus</option> <option value='bike'>Bike</option> <option value='car'>Car</option> </select> <input type='text' name='current'></input> </form> When user open vehicle.php first time then in...

DropDownList MVC C#

Hello all, I want to create a dropdownlist, but am struggling with how I display it. I have the following code. Controller var trader = new DisplayTradersAttachedToCategoryViewModel { Description = data.Description, Id = data.Id, BusinessName = traders.Select(x =...

System.ArgumentNullException when adding AutoPostback to DropdownList

Hi, When I add AutoPostback = True to my DropDownList (with OnSelectedIndexChanged) I get a System.ArgumentNullException: Value cannot be null. My control looks like this: <asp:DropDownList ID="dropdown" runat="server" AutoPostBack="true" OnSelectedIndexChanged="dropdown_OnSelectedIndexChanged" /> And code to fill control: dr...

ASP.NET MVC: DropDownListFor doesn't select any option

I have this to populate a drop down list in an ASP.NET MVC view. <%= Html.DropDownListFor(model => model.Bikes, Model.Bikes.Select( x => new SelectListItem { Text = x.Name, Value = Url.Action("Details", "Bike", new { bikeId = x.ID }), Selected = x.ID == Model.ID, })) %>...

Prevent same value chosen in several dropdown lists

Hi, I have four dropdown lists with same items/values. I want to prevent the same value is chosen more than once when the form is uploaded. How can I do that using a custom validator? Thanks! ...

Help me create a dropdownlist of all Jefes in my database!

Hi guys, I have the following table structure: I'm trying to populate a combobox of all the Jefes when editing an Area. Meaning I can change who's in charge of an area. Here is my AreaController.cs code: public ActionResult Edit(int id) { Area area = areaRepository.GetArea(id); JefeRepository jefe = n...

asp.net DropDownList event not firing

Hello, I have a problem with a dropdownlist that doesn't seem to "notice" when the selected index has changed. On the form it looks something like this: <asp:DropDownList ID="DDLResponsible" runat="server"></asp:DropDownList> On the form there is another dropdownlist and when the selected index changes in that one, this one is reload...

Sending a value from a dropdown box to PHP via jQuery

Hey guys, I'm trying to take values from a dropdown two boxes and send them to a PHP file which will draw an appropriate field from a mySQL database depending on the combination chosen and display it in a div without refreshing the page using AJAX. I have the second part sorted, but I'm stuck on the first part. Here is the HTML: http:/...

How to set a controlparameter to the value of gridtemplatecolumn dropdownlist??

Hi, I have a radgrid in which there are 5 columns. one of the column is gridtemplatecolumn in which the itemtemplate is a label and edititemtemplate is dropdownlist. Code is as given below: <telerik:GridTemplateColumn DataField="GameId" HeaderText="Game Id" SortExpression="GameId" UniqueName="GameId"> ...

Problems issuing DropDownList.Items.Addrange and selecting a value

I'm new to C#, as I mainly have been using Java. But straight to the problem (which I have simplified a bit): First an excerpt of my aspx-page: <div class="dates"> <div class="firstselection"> <asp:DropDownList ID="DDFromMonth" runat="server"> </asp:DropDownList> <asp:DropDownList ID="DDToMonth" runat="serv...