HELP_ME
HELP_ME

Reputation: 2729

jQuery hide() works, but show() does not

I'm having trouble getting this script to work.

  <asp:DropDownList CssClass="workUnit" Width=80 ID="dropdownWorkUnit" runat="server" Visible="false" _clientId="comboboxWorkUnit" />

For some reason, the combobox will not become visible when I run this JavaScript.

onPhaseChange: function(dropdown, row) {
    var combobox = $(dropdown);
    comboboxWorkUnit = row.find("select.workUnit");
    comboboxWorkUnit.show();
},

But when I do this, it works:

onPhaseChange: function(dropdown, row) {
    var combobox = $(dropdown);
    comboboxWorkUnit = row.find("select.workUnit");
    comboboxWorkUnit.hide();
},

Upvotes: 1

Views: 238

Answers (1)

Amr Elgarhy
Amr Elgarhy

Reputation: 68922

I know that if you set a server side control visible=FALSE it will not render the control html in the page, and so jQuery will not find it.

Upvotes: 2

Related Questions