Check/Uncheck of Checkboxes is not happening with RadFormDecorator

2 posts, 0 answers
  1. Raju Kumar
    Raju Kumar avatar
    15 posts
    Member since:
    May 2008

    Posted 11 Jul 2008 Link to this post

        I am using "RadFormDecorator"  in my application:

      <telerik:RadFormDecorator ID="CheckBoxRadFormDecorator" runat="server" DecoratedControls="CheckBoxes"

    If i remove this i am able to check/uncheck the checkboxes using javascript.
    but using it i am not able to check/uncheck the checkboxes using javascript.

    What i need to do. Please guide.

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 11 Jul 2008 Link to this post

    Hi Raju,

    Currently RadFormDecorator does not have a method for checking / unchecking the checkboxes in a form or another element, but you can easily implement one of your own, by:

    1. Looping through the inputs with attribute type="checkbox" in the form or in their parent element, i.e:

    var checkboxes = document.getElementsByTagName('input');

    document.getElementsByTagName('input') && checkboxes.getAttribute('type') == 'checkbox';

    2. Loop through the responding labels of each checkbox in the form or in their parent, and:

    - set "unchecked" className='SkinName radfdCheckboxUnchecked';

    or respectively:

    - set "checked" className='SkinName radfdCheckboxChecked';

    If needed, use the IE Developer Toobar to view the generated classes, and how RadFormDecorator works, and do not forget to add the skin-specific class in the toggle classes, i.e - if you are using the Default skin:

    className='Default radfdCheckboxUnchecked';
    className='Default radfdCheckboxChecked'

    I hope this helps.

    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top