![year.png](/attachments/small/3/7e8a738796e0d938dcd6d9512b905f5f.png "align-right") first take a look at attachment pic to get a idea. I have two dropDownLists.1st dropDownList ID is cboPrev(oPrev) and 2nd dropDownList ID is cboNext(oNext). These both DropDownList will have the following 4 items (2014, 2015, 2016, 2017). User can click on dropdownlist and pick a year. # problem: # so for default item on dropDownList is "2014" but when user click on "2016" than the default first item is still "2014" - which is wrong # What I want: # So for default item on dropDownList is "2014" but when user click on "2016" than the default …

Member Avatar
Member Avatar
+0 forum 1

I am very new to the Mysql/php environment so would appreciate guidance here please. 1) I have a php program that uses a Form to enter data into a MySQL table. This is working OK when data is entered into the fields manually. 2) I have a short php script that reads data from another table and creates a drop down list of the data. This is working OK too. Now I want to substitue the drop down list for the existing input box on the form, and for the user 'selected data' in the php list to be saved …

Member Avatar
Member Avatar
+0 forum 3

i have 2 tables, first is main category will display in dropdownlist, and second is subcategory chexboxes. i have a problem in this. need to display subcategory while selecting any maincategory from dropdownlist id to display subcategory. category table: state:<select name"category" id="category"> <option value="0">...select state...</option> <option value="karnataka">karnataka</option> <option value="Tamilnadu">Tamilnadu</option> <option value="kerala">kerala</option> </select> subcategory table: inside karnataka i have data's like bangalore mysore tumkur mangalore etc inside Tamilnadu chennai coimbatore madurai salem etc inside kerala kochin pallkad etc these values i added in diff table by using first table id. if i select state as karnataka then that related cities are …

Member Avatar
Member Avatar
+0 forum 3

Hi, I am trying to call the '`getMembershipDetsPrice()`' php function in the html drop down list 'duration'. I tried to follow the W3schools tutorial but when I changed the value the html printed again. When the dropdownlist changed the value the label needs to be filled by the returned value in the '`getMembershipDetsPrice()`' php function. Also I tried to use Ajax but I never had experience with it. Could you please help? Maybe a way how I can call the php function and set the label value? <!DOCTYPE html> <?php require_once 'DBConnection.php'; require_once 'DBConnection.php'; $db = new DBConnection(); $membershipPrice; $membershipDuration; …

Member Avatar
+0 forum 0

Hi guys, I've been trying to update an updatepanel with the selected values of two dropdownlists. The updatepanel is supposed to be updated on selectedindex changed of the second dropdown. The update works on the first initial index changed, but does not work for any subsequent index change. The markup is as such: <asp:UpdatePanel runat="server" ID="pnl1" UpdateMode="Always"> <ContentTemplate> <div id="blah" runat="server" class="well well-large" style="height:100px;"> <asp:DropDownList ID="ddl1" runat="server" OnSelectedIndexChanged="func1_click" AutoPostBack="true" /><br /> <asp:DropDownList ID="ddl2" runat="server" OnSelectedIndexChanged="func2_click" AutoPostBack="true" /> </div> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel runat="server" ID="pnl2" UpdateMode="Always"> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddl2" EventName="SelectedIndexChanged" /> </Triggers> <ContentTemplate> <asp:Label ID="lbl" runat="server" /> </ContentTemplate> </asp:UpdatePanel> The Codebehind functions: …

Member Avatar
Member Avatar
+0 forum 4

Hi all. I am using Microsoft Visual Web Developer C# and am working with a database. I am using 2 tables: CONTINENT table with fields: CONTINENT_CODE and CONTINENT_NAME The other table is COUNTRIES with fields: COUNTRY_CODE and COUNTRY_NAME The 1 dropdownlist is bound to the CONTINENT table and displays the CONTINENT_NAME (with its value CONTINENT_CODE) The 2nd dropdownlist is bound to the COUNTRY TABLE and displays COUNTRY_NAME (with its value COUNTRY_CODE). Now my question is what should you do in order for when a user selects Europe, England appears in drop down list and not China (vice a versa). Thanks

Member Avatar
Member Avatar
+0 forum 1

hi, i have a drop down list populated with column names of tbl_student and a text box for searching specific value coresponding to the value selected in drop down list i do not have much knowlewdge about qureies might b m lacking there error is Incorrect syntax near '=' my code is private void Search(string field) { DataTable dt = new DataTable(); SqlConnection connection = new SqlConnection(GetConnectionString()); try { connection.Open(); //string sqlStatement = "SELECT * FROM tbl_student WHERE student_id = @student_id"; string strQuery = "SELECT * FROM tbl_student WHERE" + ddl_SearchBy.SelectedValue + "= @" + ddl_SearchBy.SelectedValue + ""; SqlCommand sqlCmd …

Member Avatar
Member Avatar
+0 forum 3

I always getting this error in my dropdownlistfor: Value cannot be null. Parameter name: items View code: @Html.DropDownListFor(model => model.SiteId, new SelectList(ViewBag.ListSiteClass, "SiteId", "SiteName"), "", new { @onchange = "GetSiteid(this.value);" }) Controller Code: [HttpPost] public ActionResult Create(ServiceDTO ms, FormCollection form) { if (ModelState.IsValid) { int sid = ms.SiteId; ServiceDAO.Insert(sid); } else { return View(); } } In loading View: public ActionResult Create() { List<SiteDTO> LSSiteNameList = SiteDAO.GetSiteNameList(User.Identity.Name); ViewBag.ListSiteClass = LSSiteNameList; var service = new ServiceDTO(); return View(service); }

Member Avatar
Member Avatar
+0 forum 14

I'm new to MVC4 programming. I want to populate a **DropDownList** from a table's field but don't know how to, although I searched for relevant material from Internet but couldn't get some workable info. There are 2 tables **Software** and **Category** (showing the type of S/w e.g. Anti-Virus or Graphics or OS etc...). In Software table, `CategoryID` is in `smallint` form which has a *foreign key relationship* with the `CategoryID` in Category table (in which `CategoryID` and `CategoryName` are the only fields). Now while creating the `Create` view to add/upload a new software, I want that the `CategoryName` of all …

Member Avatar
Member Avatar
+0 forum 1

hi i have checkboxes , textboxes and drop down list boxes in an aspx web page, how do i get the data that is being entered by the user. and where should i write the code or it thanks appreciate a reply thanks

Member Avatar
Member Avatar
+0 forum 2

how can i make vs 2010 dropdown list editable?

Member Avatar
Member Avatar
+0 forum 3

Please help me.I'll really thank for you help! How to write code for country, state and city drop down list menu? change automatically for state and city when country is selected.

Member Avatar
Member Avatar
+0 forum 1

Hello, I'm a complete noob when it comes to .Net. I'm working on my college project. In my application there's a combobox/drop-down list. My requirement is as soon as user starts typing inside it, i.e. when text_changed is triggered it should retrieve values starting from that letter from a column in the linked table. This should happend dynamically i.e. for different initial letters entries will be different so their index value should also be different each type. I tried to write a code for very basic and statically populating entries but I'm not able to get it to work, will …

Member Avatar
Member Avatar
+0 forum 1

I develop a project that consist of many tables. In admin menu table names shows dynamically in a dropdownlist from a database. Pls help me to do this

Member Avatar
Member Avatar
+0 forum 3

Hi guys, I'm defining my dropdownlist in my codebehind and it continues to crash when when I bind the dataset to the actual dropdownlist. here is the aspx file: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_332_Final_Proj.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <%-- <link href="~/Content/StyleSheet1.css" rel="stylesheet" type="text/css" />--%> </head> <body> <form id="form1" runat="server"> <div > </div> <div> <%-- <asp:GridView ID="Gv_TeamsView" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="ID" GridLines="None" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label ID="Lbl_Banner" runat="server" Text="Select A Team:" /> <asp:DropDownList ID="Ddl_Teams" runat="server" DataTextField='<%# Eval("TeamName") %>' DataValueField='<%# Eval("ID") %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>--%> <h3><u>Player Search</u></h3> <table class="tbl"> <tr> <td> <asp:Label ID="Lbl_SelectTeam" runat="server" Text="Select …

Member Avatar
Member Avatar
+0 forum 5

# What I am trying to do is as follow: # I have a html form with dropdownlists that populated by php and mysql, on the same page I have a table that displays the data that was enter in the form (obvious when submitted) my table structure: CustomerlocationId ProducttypeId Quantity dateTimelastUpdate my goal is when I add the CustomerLocationId(this value is fed by a $_POST) and the ProductTypeId to the table I want to be able remove the productTypeId that already was added and incase that the customerLocationId has more productTypeId's I want the remove them also from the …

Member Avatar
Member Avatar
+0 forum 1

Hello, Is it possible to use a PHP code to create a drop-down list that automatically inserts a word from MySQL table after writing a character? For example when I type "a", all the entries beginning with "a" show in order, then I type "n", then all entries begins with "an" show in order, and so on.

Member Avatar
Member Avatar
+0 forum 2

I am having trouble with databinding when trying to add it to a dropdownlist. I can get it to work with a label: <asp:Label ID="Label3" runat="server" Text='<%# Eval("Location") %>'></asp:Label> But when I try with the DropDownList I get this error and I can't seem to find an answer for it. Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ListItem does not have a DataBinding event. Here is the code I use: <asp:DropDownList ID="ddlLocation1" runat="server"> <asp:ListItem Text='<%# Eval("Location") %>' Value='<%# Eval("TotalCost") %>' /> </asp:DropDownList> Any help would be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 5

I add dropdown list in the form, connect with gridviev1 from table1. But I have 4 tables. I have 4 values in the drop down list. 1 when check value 1 show table1 2 when check value 2 show table2 3 when check value 3 show table3 4 when check value 4 show table4 Where I could find the code? tnx

Member Avatar
Member Avatar
+0 forum 2

I am having trouble with databinding when trying to add it to a dropdownlist. I can get it to work with a label: <asp:Label ID="Label3" runat="server" Text='<%# Eval("Location") %>'></asp:Label> But when I try with the DropDownList I get this error and I can't seem to find an answer for it. Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ListItem does not have a DataBinding event. Here is the code I use: <asp:DropDownList ID="ddlLocation1" runat="server"> <asp:ListItem Text='<%# Eval("Location") %>' Value='<%# Eval("TotalCost") %>' /> </asp:DropDownList> Any help would be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 1

Good day! I need help.. I have to check if the textbox value is in the dropdownlist items, and I don't know how to get this in javascript. I wanted to validate it in such a way that if the textbox value is in the dropdownlist item values, then the selected index will be on the that value, while if theres no value in the dropdown list item, it will be returned to it it's default index which 0. I don't know much about javascript and I really need to use it.. Thanks, Jbutardo

Member Avatar
Member Avatar
+0 forum 1

Hey guys I know it had been discussed so much but I still don't get it working. What I need is to filter a gridview by a few dropdown lists and the main idea is to "continue" filtering the gridview. I mean, when I select value from ddl1, then the ddl2 is filtered according to the selected value in ddl1 and so forth Also called cascading dropdown list but I don't want to (can not) use Ajax Control Toolkit... Any other solutions to that? Maybe the method [CODE]protected void DropDownList2_SelectedIndexChanged(...)[/CODE] can do this but I don't know how to use …

Member Avatar
Member Avatar
+0 forum 7

i want my ajax and php codes, with 2 option value, show up two different texts or form packs. i have given html and php codes. i hope sombedy help me. im quiet new with this. thanks :) renkler.html : <head> <script type="text/javascript"> var istek = false; if (window.XMLHttpRequest) { istek = new XMLHttpRequest(); } else if (window.ActiveXObject) { istek = new ActiveXObject("Microsoft.XMLHTTP"); } function.RenkGoster() { document.getElementById("kutu2").innerHTML = "lutfen bekleyiniz"; var renk = document.getElementById("renk").value; istek.open("GET", "form.php", true); istek.onreadystatechange = renkler; istek.send(null); } function renkler() { if (istek.readyState == 4 && istek.status == 200) { var cevap = istek.responseText; document.getElementById("kutu2").innerHTML = …

Member Avatar
Member Avatar
+0 forum 1

Hai all,, Currently I'm writing code in ASP.NET using VB language. I got an issue regarding dropdownlist. In my form, I have a treeview and a dropdownlist which are populated with data from database. When I click a node in treeview, the dropdownlist should be populated with values based on the selected node. This works fine at the first time page loading. But when I move to the other node of the treeview (which should trigger different dataset for the dropdownlist), the items inside the dropdownlist aren't changed. No matter how many times I change the selected node of the …

Member Avatar
Member Avatar
+0 forum 8

Hi, I am having problem on getting value from dropDown list. [CODE] using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OleDb; public partial class _Default : System.Web.UI.Page { OleDbCommand comm; OleDbConnection conn; //conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\\Demo11(1).accdb;Persist Security Info=False"); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { connectionAndData(); } } private void connectionAndData() { conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\\Demo11(1).accdb;Persist Security Info=False"); try { conn.Open(); Label1.Text = "Connection Esatblished"; if (!IsPostBack) { comm = new OleDbCommand("select w2k_id from Employee", conn); OleDbDataReader rd = comm.ExecuteReader(); while (rd.Read()) { DropDownList1.Items.Add(rd["w2k_id"].ToString()); } } } catch (Exception exp) { Label1.Text …

Member Avatar
Member Avatar
+0 forum 2

hi i have a drop down list where i select an employee id, once i click the button i want it to populate the Rate text box with the rate which matches the id from the table in sql. i have this so far but not sure if i have done it the right way and just missing code for the button or whether i am going about it the wrong way any help with this would be great! [CODE]employee ID:<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="EmployeeID" DataValueField="EmployeeID"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Ad_newConnectionString %>" SelectCommand="SELECT EmployeeID FROM HumanResources.EmployeePayHistory"> </asp:SqlDataSource> <asp:SqlDataSource …

Member Avatar
Member Avatar
+0 forum 2

Hi all, More of general question, than just about drop down objects, but that's where I noticed first, so I'm using that as my example. In the project I am working on, one of the programmers created a new drop down item using [CODE] new ListItem() {Text = "stuff", Value="someValue"}; [/CODE] I always used [CODE] new ListItem("stuff", "someValue"); [/CODE] Is there a difference or a reason why you would use one over the other? They both seem to end up with the same object. Maybe there is no difference, not really sure. The only reason that I can see it …

Member Avatar
Member Avatar
+0 forum 2

Hi I am new to PHP and looking to create a search php page, the search needs to be by Country, State and city. I have tried several methods over the last three weeks and none work, im slamming my head against my desk! Basicly I have three dropdown boxes on the top of my php page that i start off with, dropdown 1 is Country - data is pulled from mysql table tbl_country, Here comes teh problems - When Country is selected i want the States from the states table to be filled in in the dropdown (like with …

Member Avatar
Member Avatar
+0 forum 7

Hi there I have a .net (3.5) user location dropdown menu (System.Web.UI.WebControls.DropDownList) called ddlLocation, that when the user selects a location menu item that item is saved in a database table, so that the next time the user accesses the page the selection is pulled from the db table. The dropdown menu selection also updates the content of the treeview menu. This is all (db and treeview updates) done asynchronously using Ajax update panels, triggers etc. I have tested that the entry is written to the table as I can see the table being updated with each selection. I have …

Member Avatar
Member Avatar
+0 forum 1

HI there, I'm trying to create Drop Down Lists dynamically. Two thing before we start: 1. Im working on a ContentPanel that is inside a master page 2. I cant add anything to the .aspx directly, so all the code must be inside the .aspx.cs This is my code: [CODE] public void GenerateDDL(Page page){ DropDownList element; element = new DropDownList(); element.ID = "uxDropDownList"; page.Controls.Add(element); } [/CODE] So far it worked just fine when it came to adding Labels, Images and Hyperlinks dynamically; but for some reason, when I try to add the DropDownList using the very same process I get …

Member Avatar
Member Avatar
+0 forum 3

The End.