Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mesage while refreshing Drop Down Boxes

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
Hey all.. I have a question I hope someone can help me with... I currently have a form, with 3 Drop Down boxes... Role, Location, and Employee... Basically, the first 2 boxes are filtering options for the third.. Upon initial load, all 3 boxes are populated with all possible values.. When you selection a Role, it will filter the Employee Box with just employees with that role. Same thing for the Location box. This is working just fine with AJAX. However, I need to put up some type of message in the Employee Drop Down box, that lets the user know that the box is being filtered, after a Role or Location is selected.

I know that the AJAX Toolkit has a cascading drop down box control. However, this is a slightly different application. With the cascading Drop Downs, the content of each Drop Down is dependent on the previous drop down. In my application, a user can select an Employee right away, without filtering the Role and/or location.

But I am looking to emulate what the cascading drop down does. When you select an option in the first box, it will put a message in the Drop Down being refreshed, letting the user know that.

Is there a way I can do this? Without using the Cascading Drop Downs? Thanks in advance for any help.
 
I was able to figure this out.. I just created a JS function in order to add a SELECTED value to the DDL, and then added an onChange event to the initial DDL. Here is some code, in case anyone is looking for something similar...

In the ASPX page, I added this JS function..
Code:
function updateMessageEmployee()
{
   document.form1.cboEmployee.options[0] = new Option("Filtering Employees", "Load", true, true)
}

In the PageLoad function of the Code Behind, I added this..
Code:
cboRole.Attributes.Add("onChange", "javascript: updateMessageEmployee()");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top