0
<script type="text/javascript">
    $(document).ready(function () {
        var e = document.getElementById("ddlCategory");
        var value = e.options[e.selectedIndex].text;
        if(value == "Others") {
            $('#Other').show();
        } else {
            $('#Other').hide();
        }
    });
</script>

        <table>
            <tr>                   
                <td><asp:Label runat="server" Text="Category: " /></td>
                <td><asp:DropDownList ID="ddlCategory" runat="server" ClientIDMode="Static" /></td>
            </tr>
            <tr id="Other" style="display:none">
                <td><asp:Label runat="server" Text="Others: " /></td>
                <td><asp:TextBox ID="txtOthers" runat="server" /></td>
            </tr>

i tried already, and it doesn't work.
Thanks for the advanced.

2
Contributors
2
Replies
8
Views
3 Years
Discussion Span
Last Post by gahhon
0

Sorry about that,
The dropdownlist ddlCategory when Page_Load will insert insert data through code behind, Others is one of the item.
Once the user selected Others will automatically show this <tr id="Other">

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.