Question

I am creating a 1 dropdown list that have 2 options which it Window and Linux. Before user select anything, the forms are "hidden" or not exist until user is select one of options. If the user select Window, the Window form will show up to fill it out. If the user select Linux, the Linux form will show up as well. I am using a vb and can anyone give me a small example or a link of example that is pretty close to this? Do I have to dynamically create a form in vb script or the html is fine?

Here my sample codes so far,

asp.net

<asp:Content ID="Content3" ContentPlaceHolderID="Content1" Runat="Server">
        <asp:DropDownList ID="DropDownListForm" runat="server" AutoPostBack="True">
                <asp:ListItem Selected="True">Please Select</asp:ListItem>
                <asp:ListItem>Window</asp:ListItem>
                <asp:ListItem>Linux</asp:ListItem>
            </asp:DropDownList>
        <br />
        <br />
        <br />
        <div id = Window>
             Form info....
        </div>
        <div id = Linux>

         Form info....
    </div>
</asp:Content>
Was it helpful?

Solution

You can do it with javascript by making an event that will triger on select item in your drop down list. After you select item then you can make your own logic to display desired view s.

Take a look at this: Get selected value in dropdown list using JavaScript?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top