Here’s the problem folks
I’m using a Telerik RadGrid. Within is a FormTemplate with some fields and checkboxes … and that’s where it gets tricky. Some of those checkboxes actually influence fields on the form.
For example:
unchecking checkbox A would disable the field below and clear it. Checking it would enable the field again.
I’ve been looking all over the web for this and of course experimenting but it’s taking up too much time.
So my goal is to have a function called onclick of the checkbox (which works of course) and then influence the RadTextBox’s availability.
I’ve tried using normal JQuery which DOES find the control (based on a class I put on it) but this does NOT take into account the subcontrols telerik renders for formatting and such.
I’ve also tried going via the TableView’s edititems … without luck.
All scripting code is enclosed in a RadCodeBlock, as the Telerik people ask you to do in the guides 🙂
any help here would be greatly appreciated as this little problem has me baffled.
That’s the problem with Telerik controls, one HTML element is rendered as three or four elements so that they can apply their styles, etc. Look how a combobox is rendered and you’ll see what I am talking about.
If Telerik does not provide a client API for you to access the elements within the form and hide/show them, you’ll have to do what you were doing with jQuery but simply also hiding/showing the additional garbage that’s rendered for the control in question.
Fortunately, it’s easy to know what are those extra elements. Inspecting the HTML source with Firebug will show you exactly who they are and which selectors do you need to use to hide them with jQuery.