I have multiple WebPanels that on page load are disabled. Once a selection is made in a WebDropDown, the panels become enabled via javascript. The problem is every asp:Textbox that is included in the panels do not get enabled. The other radiobuttons and WebDateChoosers are enabled, just not the textboxes.
Anybody have this issue and how to fix it other than replacing all textboxes with WebTextEditors?
To add to this, I found out that the WebDateChoosers that are contained in the WebPanel, and are disabled when the panel is disabled, do not become enabled when the panel is.
Hello Will,
The issue happens because you should do a postback in order to make the changes have effect.
I can suggest you two options:
1) When you set the WebPanel to be enabled you should iterate through the controls and enable them
For example:
function WebDropDown1_SelectionChanging(sender, eventArgs) {
var text = eventArgs.getNewSelection()[0].get_text();
var panel = igpnl_getPanelById('WebPanel1');
var chooser = igdrp_getComboById("<% =WebDateChooser1.ClientID %>");
if (text == "Enabled") {
panel.setEnabled(true);
chooser.setEnabled(true);
}
else {
panel.setEnabled(false);
chooser.setEnabled(false);
2) Wrap the Controls inside update panel and turn on the AutoPostBackFlags-SelectionChanged of the WebDropDown
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" OnSelectionChanged="WebDropDown1_SelectionChanged">
<Items>
<ig:DropDownItem Selected="False" Text="Enabled" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="Disabled" Value="">
</Items>
<AutoPostBackFlags SelectionChanged="On" />
<ClientEvents SelectionChanging="WebDropDown1_SelectionChanging" />
</ig:WebDropDown>
<igmisc:WebPanel ID="WebPanel1" runat="server">
<Template>
<igsch:WebDateChooser ID="WebDateChooser1" runat="server">
</igsch:WebDateChooser>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ig:WebCaptcha ID="WebCaptcha1" runat="server" Width="250px">
</ig:WebCaptcha>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:RadioButtonList>
</Template>
</igmisc:WebPanel>
</ContentTemplate>
</asp:UpdatePanel>
Please let me know if you need further assistance regarding this.
Tsvetelina, the 2nd option of making sure all controls are wrapped in an UpdatePanel worked for me. Thanks so much!