riTextBox riEnabled is automatic added to class

2 posts, 0 answers
  1. Petar
    Petar avatar
    5 posts
    Member since:
    Jul 2012

    Posted 04 Apr 2013 Link to this post

    I am having simple
    <telerik:RadTextBox CssClass="Search-Element" ID="txtFirstName" runat="server" Width="100%"></telerik:RadTextBox>

    In html output for class i get:
    <input type="text" data-propertyname="FirstName" class="riTextBox riEnabled Search-Element" size="20" name="ctl00$ContentPlaceHolder1$ucTest$txtFirstName" id="ctl00_ContentPlaceHolder1_ucTest_txtFirstName">

    Why is riTextBox riEnabled added? This makes me problem because i need to get all .Search-Element with JS
    $('.Search-Element') is null because that riTextBox riEnabled
  2. Vasil
    Vasil avatar
    1540 posts

    Posted 08 Apr 2013 Link to this post

    Hello Petar,

    Your jQuery selector is not working because hyphen-minus is actually not valid character to be used in your custom class names. The additional "riTextBox riEnabled" classes does not prevent your selector to work. They are used to apply the default CSS for RadInput Control.

    Modify your class to "SearchElement" instead of "Search-Element" and it will work correct.

    Additionally read this help topic:

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top