Web Forms :: Disable Items For A Combobox With Javascript?
Apr 9, 2010
I've a problem with a master page and combobox items.
I would like to disable certains items on my combo box depends the contex.
I use the disable attributes but doesn't work correctly.
I would like to make with javascript.
View 5 Replies
Similar Messages:
Aug 10, 2010
I need to manipulate the combobox (from AJAX3.0) in ASP.NET through javascript. The webpage is simple. There is one dropdownlist and one combobox. When the selection of the dropdownlist changes, I need to change the combobox accordingly, may remove a few items or add new items. Right now, I know how to add items into combobox using javascript from the topic:[URL] And I need to how to remove one of the item from the combobox according to a text or just clear all items.
View 24 Replies
Mar 23, 2010
I have a Combobox
[Code]....
the combobox doesn't have a get_items() method.
How can I populate the ajaxcontroltoolkit through javascript?
View 5 Replies
Dec 27, 2010
I've a webform that has a formview in insertmode that among others has a combobox with a datasource. The problem is that user needs to have a way to add new items to combobox directly rather than having to go to mainteinance webform that deals with the info related with the table that feeds combobox. So I thought that I should have an update panel and put the combobox in there together with a button to open a popup window to add the new record, close when done and update combobox with newly added item.
In theory that's what I want. What I require are examples of how to do that in the best way. I thought first of using javascript but how do I know when the popup window was closed? how to trigger update panel?
View 3 Replies
Mar 6, 2011
I am using AjaxToolkit ComboBox in my application
<ajaxtoolkit:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Suggest"
AutoPostBack="True" DropDownStyle="DropDownList">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
<asp:ListItem>Three</asp:ListItem>
</ajaxtoolkit:ComboBox>
On running the application, i see the ComboBox but none of the list items are visible. Clicking on the dropdown button does not show anything also. Accessing the SelectedItem property shows that the first item is selected.
View 1 Replies
Nov 30, 2010
I wonder how to validate if a inserted item in a Combobox exists in a database during postback? If the item.text exists, a errormessage should notify the user that the item already exists in the database. If the item does not exists in the database a inserting should be done.
Should i use the customvalidator and create a servervalidationfunction that searches my databasetable for the item name?
Should i validate inside one of the two ComboBox control events, ItemInserting and ItemInserted?
After validating the existence i would like to validate if the inserting to the database was successfull.
View 1 Replies
Aug 12, 2010
I would like to highlight (bold) and disable certain items in the dropdownlist for selection.
My dropdownlist is fed from a SQL table of countries e.g.
Europe
-UK
-FR
-DE
-AU
I need to heading "Europe" to be not selectable? the database has a column (selectable = 0) for those heading and I need to make them not selectable on the client side.
View 9 Replies
Aug 25, 2010
I have a simple javascipt which enables/disables some checkboxes when another checkbox ticked/unticked. This works fine, however, in some instances when by page is loaded my code behind disables the same check boxes. When this happenes my original check box nolonger seems to have any influence in enableing or disabling - there is no error and all the elements seem to be found by the javascript - it just doesn't enable/disable the checkboxes.
View 5 Replies
Mar 12, 2010
I have a drop down that lists all our 40+ locations.. I then have a list box with all our locations as well. The client is presented with the question which locations have you worked at before. If they pick say 3 locations, i need to remove or disable those 3 from the drop down. I have other code for creating a drop down, but not sure where to go with this.
Here is my code for the controls and code behind:
[Code]....
View 17 Replies
Jan 25, 2011
Buenos nachos, to be brief, my question is: is it possible to allow users to add new items to a combobox at runtime without having the autopostback property set to true? I understand it needs to postback if a new item is added, but I do not want the box to postback if the user simply selects a different value!
The tag I currently have is below. Without having the autopostback="true", the comboxbox doesn't allow the user to add new items to the box >_<' Any thoughts?
<ajx:ComboBox ID="cbCompany" runat="server" Width="226px" DropDownStyle="DropDown"
OnItemInserted="addCompany" AutoCompleteMode="SuggestAppend">
</ajx:ComboBox>
I know I could add a few more controls and do an easy workaround, just wondering if it is possible to do it this way.
View 2 Replies
Feb 28, 2011
I have a set of server side combo boxes in a table. Based on client events, I need them to appear or disappear. I've tried the following with no success:
document.getElementById("cboToothNumber").style.visibility = "hidden";
$("#cboToothNumber").hide()
View 2 Replies
Jan 28, 2010
have an datatable with valuees like this
ListItem ddlItem;
foreach (DataRow dr in dt.Rows)
{
ddlItem = new ListItem(dr["names"].ToString())
lbx.Items.Add(ddlItem);
View 1 Replies
Sep 27, 2010
So the code below is called when a user selects Save on an ExtJS popup modal window. This window ONLY contains a combobox. Now, sometimes when a user saves this, and then re-opens it later on, the combobox will appear BEHIND the window all grayed out, unable to get to. Other times, it will be fine and work, and no difference in events happening either time, just complete utter inconsistency.Does anyone know what this could be?
var changeProductOK = function() {
var win = getChangeProductWindow();
if (win.subProductId.getValue() == '') {
[code]...
View 1 Replies
Sep 16, 2010
I am using a ComboBox from the ASP.NET AJAX Toolkit (version for .NET 3.5) with values populated into its DataSource property.If I use my mouse to drop the combobox down and select a value, then highlight the value and click backspace, I get an error: Microsoft JScript runtime error: '_optionListItems[...].text' is null or not an objectMy DropDownStyle is set to "DropDown" so I should be able to have text in the control that does not exactly match one of the items in it. Therefore, I do not understand why I get this error. It seems to work perfectly otherwise.
View 1 Replies
Feb 4, 2011
I have a menu with 3 Items; Home, Begineers and Experts. Menu is implemented in a masterpage and I build 3 more separate webpages which inherit the master.Userneeds to login and I store the User category in a Session["Category"].Can I disable the menu item "Expert" depending on the Session["Category"]? ( that is need to disable the menu when category is not equal to Expert)
View 2 Replies
Jan 18, 2011
I want to use something like the AutoCompleteExtender, however, if the user clicks on an item, I don't want that value to go into the text box. Doesn't anyone know how to do this?
View 1 Replies
Apr 28, 2010
I have the following items bound to my combobox:
Value: 1, Text: SNS
Value: 2, Text: ING
Value: 3, Text: ING
Choosing value 1 results in a SelectedValue of 1
Choosing value 2 results in a SelectedValue of 2
Choosing value 3 results in a SelectedValue of 2
does the combobox has as a disadvantage that the Text has to be unique?
View 1 Replies
Dec 3, 2010
I'm try to add a combobox to my form which i have done and populate it with the infomation i need but i want to stop the user from being able to edit the first 5 character in the textbox part of the combo box( 1 is this possible 2 am i going about it in the right way).
I have 3 columns fro a db to enter ips ie 123.456.7.89 at the start if each number i want (SE1)(SE2)(SE3) which i can do at the momment . So I get in the combobox list 3 items with (SE1)123.456.7.89 OR just (SE1) depending of i a result is returned from the DB. However i don't want the user to be able to edit out the (SE?) part of the sting in the textbox. When editing i've tried used the text change event to try and capture the change and make sure the string.length > 5 , but the event does not fire also when i leave the combobox it it adds to the combox list. If I refersh it goes back to how it should be with only the 3 items.
View 3 Replies
Jun 13, 2012
I have a problem with CascadingDropDown... I have two related comboboxes, where the second is a slave of the first (e.g. country the first, cities the second). What I want is that if I select one country from combobox 1 then the second must be "filtered" by that selection (it should display all the cities inside the selected country, and the actual CascadingDropDown implementation is OK), but if I leave the combobox 1 in the default option (e.g. "Please select a country") I want the second to display all the cities I have in the database. The problem is that when selecting default option for combobox 1 the second combobox is disabled and a postback to my webservice never occurs.
View 3 Replies
Feb 2, 2011
I need code to work in javascript disable for postback of checkbox. As i know with lots of google search that it is not possible..
View 6 Replies
Oct 22, 2010
Right now, I have a text box:
<asp:TextBox ID="Slider1" runat="server" AutoPostBack="True" OnTextChanged="Slider1_TextChanged"></asp:TextBox>
I also have this javascript function.
function InsertLabelData() {
PageMethods.GetLabelText(onSuccess, onFailure);
}
function onSuccess(result) {
//var lbl = document.getElementById('Slider11_mA');
document.getElementById("Slider11_mA").value =result;
}
I want manual inputs (if a user enters text inside teh textbox) to cause a postback. The ontextchanged event will be raised. HOWEVER, when this javascript function is called, it too will also set a value to the textbox. So how can I tell javascript to somehow temporarily disable the ontextchanged so that when it sets its own value, it wont' fire the postback?
Subsequently, when a user DOES go back and change teh value in the textbox, it too must also fire again.
so basically:
1. user can change textbox value and will cause postback with ontextchange.
2. javascript can also change textbox value but must not raise ontextchanged event. but must preserve the ontextchange event for the user.
View 2 Replies
Mar 20, 2014
May i know how to create the control function in asp.net  to control the values ?
Based on the DB table, it active is Y then enable values  in dropdownlist , if N then disable the values.Â
View 1 Replies
Jan 3, 2011
in aspx i written as follows
<ajaxToolkit:ComboBox ID="cmbAddressAlias" runat="server" DropDownStyle="Simple" AutoCompleteMode="Suggest" CaseSensitive="false" AutoPostBack="true" RenderMode="Inline" Width="170px" CssClass="cmbProvince" OnSelectedIndexChanged="cmbAddressAlias_SelectedIndexChanged"> </ajaxToolkit:ComboBox>
it binding correctly(datasource dynamically binded) and it raises event too while changing index but it is not raising event when we manually clearing the combobox text..if currently combobox having text "ASP" then i manually select that entire text and using del key i am deleting but it is not raising event for me.. when i change index it automatically raising event...i need to raise event while combobox is empty...
View 1 Replies
Apr 2, 2010
I have a telerik Rad Date Picker; i want to Disable it using JavaScript
if have Following Code
fucntion Dis()
{
var v = document.getElementByID('dpNow').Disabled = true;
}
<telerik:RadDatePicker id="dpNow" runat="server' />
If i use Simple asp Text Box Control it's hide with the same code ; but if i use Telerik Rad Date Picker it can't hide
View 2 Replies
Oct 27, 2010
I have a telerik Rad Date Picker; i want to Disable it using JavaScript
if have Following Code
[code]....
If i use Simple asp Text Box Control it's hide with the same code ; but if i use Telerik Rad Date Picker it can't hide
View 2 Replies