473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Dynamically enable/disable controls on dropdown selectedindex change

abehm
35
Hey all,
I'm trying to disable a couple controls if a user clicks on a certain item in a dropdown list. I can do it on postback, but if someone could help me to do it dynamically, that would be key! Thanks in advance!
Aaron
Jul 24 '07 #1
3 3414
r035198x
13,262 8TB
Hey all,
I'm trying to disable a couple controls if a user clicks on a certain item in a dropdown list. I can do it on postback, but if someone could help me to do it dynamically, that would be key! Thanks in advance!
Aaron
Call a Javascript function onChange of the dropdown and you're done! The function that you call will simply disable the items based on the value selected in the drop down.
Jul 24 '07 #2
pbmods
5,821 Expert 4TB
Merged duplicate threads.
Jul 24 '07 #3
abehm
35
yeah, i understand that's what I have to do. I just don't know if this function will work:
Expand|Select|Wrap|Line Numbers
  1.  
  2. function IsSelected()
  3. {
  4.     if ((cboParameters.SelectedItem.Text == "All Passed Tests") || (cboParameters.SelectedItem.Text == "All Failed Tests")
  5.             || (cboParameters.SelectedItem.Text == "All Incomplete Tests") || (cboParameters.SelectedItem.Text == "All Complete Tests"))
  6.     {
  7.         cboOperators.Visible = false;
  8.         txtComparisonValue.Visible = false;
  9.         lblMessage.Text = "";
  10.     }
  11.     else
  12.     {
  13.         cboOperators.Visible = true;
  14.         txtComparisonValue.Visible = true;
  15.     }
  16. }
  17.  
also, this is in an asp page, not html.
Jul 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
1
by: C Downey | last post by:
I have a registration form that should load different web user controls based on the selection of a dropdown list. Basically, the user follows the following steps: 1. user comes to very basic...
3
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user...
4
by: in da club | last post by:
I have a datagrid and a dropdown in my page. I want to fill dropdown with my pagenumbers. When a user change the dropdown selected index i wnt to display the result on label1. Anytime i change the...
3
by: bhanubalaji | last post by:
hi, I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA.. can any one help regarding this.. What's the wrong with my code? I am...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
3
by: =?Utf-8?B?UGxhdGVyaW90?= | last post by:
I have link buttons in a Gridview that, depending on the value in another column (Not the Key column) will need to be disabled. For example, (Column2 has link buttons) Column1 ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.