This is a migrated thread and some comments may be shown as answers.

$find("<%= RadCombox1.ClientID %>"); gets null

3 Answers 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nsi
Top achievements
Rank 1
Nsi asked on 15 Mar 2014, 09:04 AM
Hello Team,

I needed to select RadCombox1 and disable using javascript but I found $find with RadCombox returns null.Is there any work around for this because I am currently blocked on this?
 
1.<telerik:RadComboBox ID="RadCombox1" runat="server" >
2.     <Items>
3.         <telerik:RadComboBoxItem Text="Aba" Value="1" />
4.         <telerik:RadComboBoxItem Text="Enugu" Value="2" />
5.     </Items>
6. </telerik:RadComboBox>
7. 
8. var badRad = $find("<%= RadCombox1.ClientID %>");

the value of badRad  is null. Can someone help?

Thanks,
Nsi.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Mar 2014, 05:55 AM
Hi,

Unfortunately I  couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadComboBox ID="RadCombox1" runat="server">
    <Items>
        <telerik:RadComboBoxItem Text="Aba" Value="1" />
        <telerik:RadComboBoxItem Text="Enugu" Value="2" />
    </Items>
</telerik:RadComboBox>

JavaScript:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad() {
            var combo = $find('<%=RadCombox1.ClientID %>');
        }
    </script>
</telerik:RadCodeBlock>

Please provide your full code if it doesn't help.
Thanks,
Shinu.
0
Nsi
Top achievements
Rank 1
answered on 17 Mar 2014, 08:15 AM
Hello Shinu,

I tried both:
var combo = $find('<%=RadCombox1.ClientID %>'); and
var combo = $find("<%= RadCombox1.ClientID %>"); and still have combo  to be null.

We are using telerik version 2014.1.225.40. Could you please validate this issue against this version.

Thanks.
0
Shinu
Top achievements
Rank 2
answered on 18 Mar 2014, 03:26 AM
Hi,

Please try the sample project which works fine at my end. Let me know the sample code is working fine or not at your end. Please provide your full code if it doesn't help.

Thanks,
Shinu.
Tags
ComboBox
Asked by
Nsi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Nsi
Top achievements
Rank 1
Share this question
or