1st Drop-down selection determins selected value in all drop-downs In ASP.Net Wizard

Discussion in '.NET' started by jaysch, Apr 30, 2011.

  1. jaysch

    jaysch

    Joined:
    Apr 30, 2011
    Messages:
    1
    I have converted a standard ASP.net Web Form written in VB into a multi-step Wizard control. There is a section/step in the form that contains 4 drop-downs. All 4 drop-downs contain the same list items and values:

    <asp:DropDownList ID="ddl1st" runat="server">
    <asp:ListItem value="">-- Select One --</asp:ListItem>
    <asp:ListItem value="15,000/30,000">15,000/30,000</asp:ListItem>
    <asp:ListItem value="25,000/50,000">25,000/50,000</asp:ListItem>
    <asp:ListItem value="50,000/100,000">50,000/100,000</asp:ListItem>
    <asp:ListItem value="100,000/300,000">100,000/300,000</asp:ListItem>
    </asp:DropDownList>

    When a selection is made from drop-down #1 (ddl1st), I would like the remaining 3 drop-downs (ddl2nd, ddl3rd, ddl4th) to automatically select the same selected item as the ddl1st.

    So, for example, if the user selects '50,000/100,000' from 'ddl1st', I would like ddl2nd, ddl3rd, and ddl4th to also select '50,000/100,000'.

    I was using the JQuery Date Picker for date fields and a JS solution for the drop-downs but all that stopped working when I converted the standard form into a Wizard control. I am now using the Ajax toolkit Calendar extender for date fields and would like to come up with an ASP.Net solution for the Drop-down issue described above.

    I need something that works within the following structure:

    <form runat="server" name="quoteform">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

    <asp:Wizard ID="Wizard1" />
    <asp:WizardStep ID="WizardStep1" runat="server" StepType="Step">

    <table >
    <tr>
    <td><strong>Bodily Injury:</strong></td>
    <td><asp:DropDownList ID="ddlVeh1BodInjury" runat="server">
    <asp:ListItem value="">-- Select One --</asp:ListItem>
    <asp:ListItem value="15,000/30,000">15,000/30,000</asp:ListItem>
    <asp:ListItem value="25,000/50,000">25,000/50,000</asp:ListItem>
    <asp:ListItem value="50,000/100,000">50,000/100,000</asp:ListItem>
    <asp:ListItem value="100,000/300,000">100,000/300,000</asp:ListItem>
    <asp:ListItem value="250,000/500,000">250,000/500,000</asp:ListItem>
    <asp:ListItem value="500,000/500,000">500,000/500,000</asp:ListItem>
    </asp:DropDownList></td>
    <td><asp:DropDownList ID="ddlVeh2BodInjury" runat="server" >
    <asp:ListItem value="">-- Select One --</asp:ListItem>
    <asp:ListItem value="15,000/30,000">15,000/30,000</asp:ListItem>
    <asp:ListItem value="25,000/50,000">25,000/50,000</asp:ListItem>
    <asp:ListItem value="50,000/100,000">50,000/100,000</asp:ListItem>
    <asp:ListItem value="100,000/300,000">100,000/300,000</asp:ListItem>
    <asp:ListItem value="250,000/500,000">250,000/500,000</asp:ListItem>
    <asp:ListItem value="500,000/500,000">500,000/500,000</asp:ListItem>
    </asp:DropDownList></td>
    <td><asp:DropDownList ID="ddlVeh3BodInjury" runat="server" >
    <asp:ListItem value="">-- Select One --</asp:ListItem>
    <asp:ListItem value="15,000/30,000">15,000/30,000</asp:ListItem>
    <asp:ListItem value="25,000/50,000">25,000/50,000</asp:ListItem>
    <asp:ListItem value="50,000/100,000">50,000/100,000</asp:ListItem>
    <asp:ListItem value="100,000/300,000">100,000/300,000</asp:ListItem>
    <asp:ListItem value="250,000/500,000">250,000/500,000</asp:ListItem>
    <asp:ListItem value="500,000/500,000">500,000/500,000</asp:ListItem>
    </asp:DropDownList></td>
    <td><asp:DropDownList ID="ddlVeh4BodInjury" runat="server" >
    <asp:ListItem value="">-- Select One --</asp:ListItem>
    <asp:ListItem value="15,000/30,000">15,000/30,000</asp:ListItem>
    <asp:ListItem value="25,000/50,000">25,000/50,000</asp:ListItem>
    <asp:ListItem value="50,000/100,000">50,000/100,000</asp:ListItem>
    <asp:ListItem value="100,000/300,000">100,000/300,000</asp:ListItem>
    <asp:ListItem value="250,000/500,000">250,000/500,000</asp:ListItem>
    <asp:ListItem value="500,000/500,000">500,000/500,000</asp:ListItem>
    </asp:DropDownList></td>
    </tr>

    </asp:WizardStep>
    </asp:Wizard>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>

    Coded examples please, thanks in advance!
    jaysch, Apr 30, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    751
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,008
    weiwei
    Jan 5, 2007
  3. =?Utf-8?B?cGVsZWdrMQ==?=

    asp.net 2 drop down list and a selected saved value

    =?Utf-8?B?cGVsZWdrMQ==?=, Jul 11, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    458
    =?Utf-8?B?cGVsZWdrMQ==?=
    Jul 11, 2007
  4. mcraven.2@wright.edu
    Replies:
    5
    Views:
    159
    news@chthonic.f9.co.uk
    Jul 26, 2006
  5. teser3@hotmail.com
    Replies:
    0
    Views:
    173
    teser3@hotmail.com
    Jan 28, 2009
Loading...

Share This Page