4 Answers, 1 is accepted
0
Hello Matt,
Here is how you can achieve that:
1. Subscribe the on OnClientFormCreated event: OnClientFormCreated="onClientFormCreated"
2. Add the following javascript code to your page:
I hope this helps.
Regards,
Veselin Vasilev
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.
Here is how you can achieve that:
1. Subscribe the on OnClientFormCreated event: OnClientFormCreated="onClientFormCreated"
2. Add the following javascript code to your page:
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
<script type="text/javascript"> |
function onClientFormCreated(sender, e) |
{ |
shouldBeEnabled = false; |
} |
var shouldBeEnabled = true; |
function pageLoad() |
{ |
toggleCombo(shouldBeEnabled); |
} |
function toggleCombo(state) |
{ |
var combo = $find("<%= RadComboBox1.ClientID %>"); |
switch (state) |
{ |
case true: combo.enable();break; |
case false: combo.disable(); shouldBeEnabled = true; break; |
} |
} |
</script> |
</telerik:RadScriptBlock> |
I hope this helps.
Regards,
Veselin Vasilev
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
Matt
Top achievements
Rank 1
answered on 18 May 2009, 06:12 PM
Wow, that's slick. That disables the box. What javascript would I use to hide the combobox?
0
Accepted
Hi Matt,
Ah, yes, here is the modified toggleCombo function:
Best wishes,
Veselin Vasilev
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.
Ah, yes, here is the modified toggleCombo function:
function toggleCombo(state) |
{ |
var combo = $find("<%= RadComboBox1.ClientID %>"); |
switch (state) |
{ |
case true: combo.get_element().style.visibility = ""; break; |
case false: combo.get_element().style.visibility = "hidden"; shouldBeEnabled = true; break; |
} |
} |
Best wishes,
Veselin Vasilev
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
Matt
Top achievements
Rank 1
answered on 19 May 2009, 03:41 PM
Thanks for the code! Took what you gave me, modified it a little bit and it works great. Here's my modified code just in case anyone can use it:
I have a table with id="tblComboBoxes' which include multiple label and comboboxes. This hides the entire table when the edit form is called.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> | ||||
<script type="text/javascript"> | ||||
//<![CDATA[
|
||||
var shouldBeEnabled = true; | ||||
function pageLoad() { | ||||
toggleCombo(shouldBeEnabled); | ||||
} | ||||
function toggleCombo(state) { | ||||
var combo = document.getElementById('tblComboBoxes') | ||||
switch (state) { | ||||
case true: combo.style.visibility = ""; combo.style.display = ""; break; | ||||
case false: combo.style.visibility = "hidden"; combo.style.display = "none"; shouldBeEnabled = true; break; | ||||
} | ||||
} | ||||
//]]> | ||||
</script> | ||||
</telerik:RadScriptBlock> |
I have a table with id="tblComboBoxes' which include multiple label and comboboxes. This hides the entire table when the edit form is called.