I have a gridview with a dropdownlist and a textbox to search the gridview. The dropdownlist specifies the column to search and the text box holds the string to search for. Like this:
<asp:DropDownList ID="SearchByDropDownList" runat="server">
<asp:ListItem Text="First Name" Value="first_name" />
<asp:ListItem Text="Last Name" Value="last_name" />
<asp:ListItem Text="Birth Date" Value="birth_date" />
</asp:DropDownList>
<asp:TextBox ID="SearchTextBox" runat="server"></asp:TextBox>
<asp:Button ID="SearchButton" runat="server" Text="Search" OnClick="SearchButton_Click" />
<asp:Button ID="ClearButton" runat="server" Text="Clear" OnClick="ClearButton_Click" />
What I want to happen is that when the user selects the "Birth Date" list item, the single text box changes into two text boxes so that the user can specify a date range (i.e., starting date and ending date). If the user selects one of the non-date list items then the display would change back to a single text box. Preferably it would be client-side, so that no round trip to the server is necessary just to change the display. How can I do this?
If a post helps me I'll always eventually mark it as an answer. But I frequently don't mark it right away because I feel once a thread is marked as answered, discussion tends to end. And I like to discuss things a bit.