dropdownlist

javascript option select problem

I got this javascript code from off the internet. It's a script that changes a picture and it caption from the selection of an options drop down box. The script works fine. The only problem that I have is that the value in the option box can only be numbers. Is there anyway to tailor this whereas the value within the options parameter ca...

How do I add options to a DropDownList using jQuery (ordered)?

This question is similar to this one http://stackoverflow.com/questions/317095/how-do-i-add-options-to-a-dropdownlist-using-jquery but I would like to add it in an ordered fashion. The example in the other question just adds it to the end of the list. The code is as follows: var myOptions = { 1: "Test" 2: "Another" }; $.each...

When I click a button on the form...my code never reaches it's onclick event.

I have a dropdownlist and a textbox with a button on a form. When a button is clicked it does not go to my onclick even in the code but it goes to my dropdownlist's selectedIndexchanged event. How can I fix this? ...

DropDownList, ListItems and SelectedItem

See also: http://stackoverflow.com/questions/428001/dropdowns-filled-with-same-list-item After a day of tracing and debugging, I finally figured out that populating 3 DropDownLists with the same collection of items causes the last selected item to appear in all 3 lists. This appears to be due to the 'selectedness' of an item being a ...

How to bind an Html.DropDownList without ViewData (Strongly-Typed View)

I can't seem to find a good blog post that shows how to bind a model to a view without the magic strings "ViewData" (using a strongly-typed view is the approach I'm trying to take) Does anyone know what I need to alter in the below to bind this directly to my model? View <%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Maste...

DropDownList SelectedValue not binding properly

I have a DropDownList populated with a SelectList generated from (an anonymous type) that has two properties "CountryId" (int) and "Description" (string). I want the selected country in the list to be the defaultCountry. Countries = new SelectList(countries, "CountryId", "Description", defaultCountry.CountryId); where "countries" is a...

How can I change content on my page based on the selected value of an HtmlHelper DropDownList?

Hello, I am using ASP.NET MVC and want to update content on my page based on the selected value of an HtmlHelper.DropDownList. I have an Admin page on which I would like to display a list of hired employees for a given semester, without having to redirect to another controller. Perhaps a table could be generated or a ListBox filled with...

How to declare and iterate an array in XSLT?

My requirement is -using XSLT- to show a dropdown list with the US states and print 'selected' on one specific that is declared in the XML which will use my style sheet. I was thinking on declare an array with the states and iterate it but I don't know how to do it. NOTE: More ideas are welcome ;) ...

Alternative to drop down list?

There are 30-35 items in a list and it is expected to grow further. What could be the best way to put it on the page? Dropdown list is the first control that comes to mind, but it could easily become a pain as the list grows. What could be the best usability control to present such kind of long list? ...

How do you create a form dropdown from a database table in php?

I am trying to code a function which creates a dropdown of school names selected from a database. It is doing fine creating a dropdown but it is not putting anything in the dropdown. Here is the code: function schoolDD($name, $selected){ $select = ''; if( $selected != null ) { $select = $selected; } $qry = "selec...

Adding 2 drop lists to associated table

Hi, I am having an issue trying to add the records using 2 drop lists. I have a table called Urls which holds the details of url. I have a table called category populates a drop list, I have another table called publishers which populates another drop list. $query = 'INSERT INTO url_associations (url_id, url_category_id, approved,...

Is there a simple way of populating dropdown in this Access Database schema?

Hello! I have 3 tables which look like this: Location Node Sektor ----- ------- ------- PK: ID - Autonumber PK: ID - Autonumber PK: ID - Autonumber Name NodeName Sektor Height Aksess Frequency Latitude ...

get selected row index of dynamic dropdown list selection

I know the question is a little choppy and perhaps misleading,but I have a gridview with dropdownlists on the rows. I created an AddHandler and a Delegate for the SelectedIndexChanged and it gets to the sub. Here is the code for that: AddHandler ddlmgr.SelectedIndexChanged, AddressOf ddlmgr_SelectedIndexChanged Public Delegate Sub DropD...

ASP.NET Dynamic data Change text field to dropdown and populate with some data

Hi, I have an ASP.NET dynamic data site and for one of the text fields within Edit and Insert templates I'd like to covert it to dropdown and populate that drop down programmatically. Can you help or point into right direction ? Thanks. ...

Dropdown list and gridview row-index/selectedvalue issue.

I have a gridview with a dropdown list that was created programmatcially. I want to have access to the selected value and to that row's Id. I have the dropdownlist created in *Gridview_RowDataBound* and I am able to use the text in the cell but my addHandler is never fired. Where do I give it the Add handler. I believe I can assign it ...

Addhandler is not firing off in rowdatabound

I am creating a dropdown list in code for a gridview. I want to create an addhandler so I can have access to the selectedvalue. However, here (Rowdatabound) the add handler does not get fired off. How should I go about this? Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEven...

Populate DropdownList based upon other DropDownList VB

I have found a couple of examples on the internet to do this but really struggling to get it working in VB. (Tried a converter but had mixed results) I need the selection options of a Dropdownlist to be populated based upon the differing values in the first dropdown list. Can anyone help with a releativley simple example in VB? Not fus...

Add empty value to a DropDownList in ASP.net MVC

I'm building a data entry interface and have successfully bound the columns that have reference tables for their data using DropDownList so the user selects from the pre-configured values. My problem now is that I don't want the first value to be selected by default, I need to force the user to select a value from the list to avoid erro...

ASP.Net MVC Add Items To Bound Dropdownlist

My page view currently has a dropdownlist on it that is getting bound to a collection from the controller. This is working fine, However I want to insert an item to the top of the dropdownlist that is not in my collection e.g the list currently gets the following items Open Closed I want to add a third option of "All" but I don't want...

Error trying to populate a drop down list during a "GET" create action

Hi, I am trying to understand something a bit better with being new to C#, .NET 3.5 and MVC. I am running through the MVC NerdDinner example and if you look at the ViewModel here: http://nerddinnerbook.s3.amazonaws.com/Part6.htm#highlighter_662935 You can see the Country list and how it gets populated, this seems to work fine but I tri...