dropdownlist

Toggle dropdownlist enable and disable with a button click using Javascript?

I have the following JavaScript to disable a dropdownlist in a ASP.NET page , which gets called when I click a button. function disableDropDown(DropDownID) { document.getElementById(DropDownID).disabled = true; return false; } I wanted to use the same button to toggle between enable and disable for that dropdownlist. How do I do ...

Array count values

Hi Friends,... I am new to php, i have some problem in php page. This page contain one while loop, in that loop itself taking record from data base, it showing taxt box, list box like this,,,etc..Here php page while loop contain more then 5 records. here i need to select list box value to pass post to set session in next page. From that ...

Getting DropDownList Value is generating strange behavior

I have a DropDownList on a page <select name="Pages1$RadPanelBar1$i0$i0$ddlParentPage" id="Pages1_RadPanelBar1_i0_i0_ddlParentPage" tabindex="2"> <option value="0">[main menu]</option> <option value="1">Home</option> <option value="3">Getting Connected</option> <option value="5">Communications</option> <option value=...

Client Side javascript call from ASP control throws "Too many characters in character literal" error!

I have a javascript to enable text boxes when called, I want to trigger this code when a user picks value "Custom" from a dropdownlist, so that I can display/Hide these new textboxes. <asp:DropDownList ID="DateRangeDropDownList" runat="server" Enabled="False" **OnSelectedIndexChanged="EnableTextBoxes('SomeValue');"**> ...

Client Side javascript call from ASP control doesn't reset visibility

I have a javascript to enable text boxes when called, I want to trigger this code when a user picks value "Custom" from a dropdownlist, so that I can display/Hide these new textboxes. function setVisibility(DropDownListID) { var element = document.getElementById(DropDownListID); var element1 = document.getElementById("TestBox1")...

Manually insert items into DDL after data binding...

I have a dropdownlist, which dynamically populate data from SQL Server and i wanna manually insert two items on top of the DDL after data binding. So, the DDL would has data something like this: Select Branch (manually insert) ALL (manually insert) AIR AMP ABG ... I tried to achieve it by using code below: ddlBranch.It...

please tell me how can i access value of gridview's cell in javascript

i have a gridview witch contain 4 databound columns and 2 templated column. in one of template column i placed a dropdownlist(witch contain number of items). and 2nd column of gridview contains prices. so in last column i want that when i select value in dropdownlist that value should multiply with 2nd column's value of datagrid and plac...

Retrieve SharePoint List Data and bind this to a dropdownlist

Hi All, I'm fairly new to SharePoint so apologies in advance for sounding like a 'Newbie'. I have created a simple Webpart, which uses a Web User Control - [.ascx file] to provide all the controls for the Webpart. On the .ascx file, there is a DropDownList which is hard-coded at the moment and works well in the Webpart (within a ShareP...

YUI Custom Event for Dropdown value pre-selection ?

I have a dropdown field and its value is pre-selected as soon as its rendered(Say, its a Country field in a signup form). And I have other dropdowns or other components which change the selected value of the first dropdown dynamically. Now I want to fire a method with every "value getting selected" in the dropdown. Is it possible? To pu...

ASP.NET / SQL drop-down list sort order

I am trying to correct the sort order of my ASP.NET drop down list. The problem I have is that I need to select a distinct Serial number and have these numbers organised by DateTime Desc. However I cannot ORDER BY DateTime if using DISTINCT without selecting the DateTime field in my query. However if I select DateTime this selects eve...

Best way to check if a drop down list contains a value?

When the user navigates to a new page, this ddl's selected index is determined by a cookie, but if the ddl doesn't contain that cookie's value, then I'd like it to be set the 0. What method would I use for the ddl? Is a loop the best way, or is there a simply if statement I can perform? This is what I've attempted, but it doesn't return...

Event handler of Dropdownlist inside Gridview

I've added Dropdownlist in Gridview at RowDataBound event. The code is: if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddlSeason = new DropDownList(); ddlSeason.DataSourceID = "odsRoomSeason"; ddlSeason.DataTextField = "SeasonTittle"; ddlSeason.DataValueField = "SeasonID"; ddlSeason.AutoPostBack = true; ddlSeason.Selec...

dropdownlist value not passed .net

i am working on an already built program with a lot of classes and jscripts. the issue is the code has 3 dropdownlist's month, date, year. I need to remove the date one and passa static "01" value. here's the code for validating date in javascript - function Validate_date(sender, args) { var m = document.getElementBy...

vb.net dropdownlist populate

i need to populate my dropdownlist with month and year values to getdate + 1 year. I also want them in text format so "January 2009 and not 1 2009. This is the code i have written to populate the values. how do i convert them to January from 1? Public Sub Load_xxxx(ByRef DDL As System.Web.UI.WebControls.DropDownList) Try ...

dropdownlist format and then convert

i need a dropdownlist to show current month and year (January 2010) till January 2011, and an additional record of January 2011 +. But I want to save this in the database as 01/01/2010 format. also if the user selects current month then the record should be getdate() to go in database, else for any other month it should be 02/01/2010 (da...

How do i get these things horizontal instead of vertical?

http://we-live.in/city.html -- id like to see RESOURCES and EVENTS side by side bc im listing 3 more... rather than on top of one another -- can i do that within the div or do i have to redesign the layout? <div id="row1"> <div class="wrapper"> <h2><script type="text/javascript"> <!-- document.write('<form name="selecter1"><...

dropdownlist .net

this is my code in vb.net - Public Sub Load_dates(ByRef DDL As System.Web.UI.WebControls.DropDownList) Try Dim i As Integer Dim j As Integer Dim time As DateTime = DateTime.Now For i = Now.Year To Now.Year For j = 0 To 11 DDL.Items.Add((time.AddMonths(j)).ToString("MMMM") +...

Populate Dropdown from SQL in Classic ASP

I am trying to force users to only select certain values when adding a record. So naturally I am using a dropdown, but I'd like the options to be populated by a specific field in the database. I figured I'd do a Do/Loop but I am apparently doing something wrong. Dim dstrSQL Dim drs dstrSQL = "SELECT EventID FROM Events" set co...

disable select dropdown during .getjson jquery call and reenable after complete

i have the following code where i getJSON after i click on a select box. Sometimes it takes a long time and the users are clicking on the dropdown again during the server side processing. Is there anyway to disable the dropdown during the server side call and reenabled it after the processing is complete. here is my code <script typ...

How do I a preselect an item in a List(Of SelectListItem) for DropDownList in ASP.NET MVC VB.NET

I have a List(Of SelectListItem) and I fill it with NativeName as .Text and the two letter ISO region name as .Value. Dim countryList As IList(Of System.Globalization.RegionInfo) = GetRegionInfosForEuOnly() Dim dropDownCountryList As New List(Of SelectListItem) For i As Integer = 0 To countryList.Count - 1 dropDownCountryList.Ad...