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

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

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

Recommended Answers

Please clarify what your objective is...

Jump to Post

All 2 Replies

Please clarify what your objective is...

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">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.