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

Can't hide checkbox javascript

5 Answers 180 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
ataya
Top achievements
Rank 1
ataya asked on 08 Apr 2009, 05:07 PM
I have a two radio buttons and checkbox that when one of the radio buttons is selected the the check box should be unchecked and hidden..

I have tried this 

//hide: 0 or 1 to determine hide or show action 
function HideShowTakeMeThere(chk_TakeMeThere,lbl_TakeMeThere, hide) 
{   
var chk = document.getElementById(chk_TakeMeThere);  
var lbl = document.getElementById(lbl_TakeMeThere);  
chk.style.visibility = lbl.style.visibility = hide == 1 ? "hidden" : "visible";  


which work great until I added form decorator .. now it doesn't work at all 
so I tried as well but not working also  
 chk.style.display = 'none'

any ideas?
thank you

5 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 09 Apr 2009, 08:54 AM
Hi ataya,

I already answered to your question in the other ticket you've sent.

Greetings,
Martin Ivanov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Matthew
Top achievements
Rank 1
answered on 01 May 2009, 06:58 PM
Martin,

Do you mind posting the response here, too?

Matthew
0
Georgi Tunev
Telerik team
answered on 04 May 2009, 08:08 AM
Hi Matthew,

You can find below Martin's reply


Please, find attached the script that toggles skinned checkboxes via radiobuttons as toggles their checked state via JavaScript. In short - when we skin the controls, we hide the real control, and make use of its label, by attaching it checked or unchecked CSS classes. I have added comments in the script of what is what, and I believe you will be able to further develop the script, if you need to add more functionality.

Kind regards,
Martin Ivanov




Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard
Top achievements
Rank 1
answered on 15 Oct 2009, 01:11 PM
Could Telerik include a javascript helper functions that would enable / hide / etc skinned controls. The functions should work with non-skinned controls as well.
0
Martin
Telerik team
answered on 16 Oct 2009, 07:36 AM
Hello Richard,

The functionality you have requested has been a topic of a ongoing discussion in Telerik, however we still are still not unannimous on the methods we should implement - probably there should be a toggle checked / unchecked and toggle disabled / enabled methods but it is unlikely that we implement a toggle visibility to the controls, as this is not a functionality that the real controls have.

Have a great weekend,
Martin Ivanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
FormDecorator
Asked by
ataya
Top achievements
Rank 1
Answers by
Martin
Telerik team
Matthew
Top achievements
Rank 1
Georgi Tunev
Telerik team
Richard
Top achievements
Rank 1
Share this question
or