Mitchel's Forums

Subject:  $FIND function failing to find control.
Prev Next
You are not authorized to post a reply.

AuthorMessages
hchattawayUser is Offline
New Poster
New Poster
Posts:11

09/03/2008 2:51 PM  

Hello

I am looking to change the color of one combobox when the value of another combobox changes.

i.e. cmbOne is changed from "Select..." to "Entered Date", on the client side, I'd like to change the backcolor of cmbTwo to red to show it is now required... Any examples of how to do that? I am using Telerik controls, but I have seen people having this error with or without these controls.

This is the script I am using now... it can not resolve the $find("
<$#cmbCompare.ClientID%>") statement in line 4, even though that control exists on the page...I have this hooked up to the "onclientselectedindexchanged" client event. The problem is that when I look at the generated code in the FoxFire tool "FireBug", the code on line 4 gets evaluated to

        var compareChoice = $find(""); 

Then when I click on the combobox this is attached to, the error is "compareChoice is null"...

1[script removed]
2    // 
3    function SetCompareRed(sender, eventArgs) { 
4        var compareChoice = $find("<$#cmbCompare.ClientID%>"); 
5        compareChoice.BackColor = "Red"
6    } 
7    //]]> 
8[script removed] 

Thanks for any help!
Harold

Mitchel SellersUser is Offline
Site Admin/Owner
Guru
Guru
Posts:5607

09/04/2008 4:40 PM  
I am not familar with the "$find" method.

-Mitchel Sellers
MCITP, MCPD, MCTS
Director of Development
IowaComputerGurus Inc.

View Mitchel Sellers's profile on LinkedIn

3Essentials is my recommended Shared Hosting Provider

This site is hosted on a VPS from HostMySIte.com

Mosso is my recommended cloud computing provider. Use reference code REF-ICG to get $100 off your second month!

To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs
hchattawayUser is Offline
New Poster
New Poster
Posts:11

09/08/2008 10:16 AM  

Hi Mitch,

The solution to the original problem was to enclose the script in Telerik's special control...

 

AN explanation of it is here at Rick Strahls website : http://www.west-wind.com/weblog/posts/5758.aspx

 

Now that it gives back the correct control ID, it is still not changing the color correctly. But I am not worried about that right now... I'll tackle that later..

 

Harold

 

 

 

You are not authorized to post a reply.
Forums >Development Discussion >DotNetNuke > $FIND function failing to find control.



ActiveForums 3.7