I am using the following code to hide a dropdown box:
<asp:DropDownList ID="test1" runat="server" DataSourceID="dsTestType" CssClass="maptest1" visible="false"
DataValueField="test_code" DataTextField="test_desc" AppendDataBoundItems="true" >
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
Somehow I try to show this dropdown by using the following code, but this is just not working for me. Anyone know why?
$("#test1").show();
You can then use the jQuery hide() and show() functions. Show activity on this post. Set the CSS property visibility to visible . Show activity on this post.
visible = function() { return this. each(function() { $(this). css("visibility", "visible"); }); }; }(jQuery));
var _visible = ($('#elementID'). css('visibility') == 'hidden') ? '' : 'visibility:hidden'; $('#elementID'). attr('style',_visible);
jQuery hide() Method The hide() method hides the selected elements. Tip: This is similar to the CSS property display:none. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page).
Depends on how you hid it.
If you used the CSS visibility
value then
$('#test1').css('visibility', 'visible');
If you used CSS `display'
$('#test1').css('display', 'block'); //or inline or any of the other combos
You might even have made it opacity = 0
$('#test1').css('opacity', '1');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With