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

Check/Uncheck of Checkboxes is not happening with RadFormDecorator

1 Answer 56 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Raju Kumar
Top achievements
Rank 1
Raju Kumar asked on 11 Jul 2008, 11:18 AM
Hi,
    I am using "RadFormDecorator"  in my application:

  <telerik:RadFormDecorator ID="CheckBoxRadFormDecorator" runat="server" DecoratedControls="CheckBoxes"
            Skin="Mac"></telerik:RadFormDecorator>


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.

Thanks
Raju

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Jul 2008, 11:48 AM
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
Tags
FormDecorator
Asked by
Raju Kumar
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or