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

4 posts, 0 answers
  1. Nsi
    Nsi avatar
    6 posts
    Member since:
    Oct 2011

    Posted 15 Mar 2014 Link to this post

    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.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2014 in reply to Nsi Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nsi
    Nsi avatar
    6 posts
    Member since:
    Oct 2011

    Posted 17 Mar 2014 in reply to Shinu Link to this post

    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.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2014 in reply to Nsi Link to this post

    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.
Back to Top