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

Joined
Apr 30, 2011
Messages
1
Reaction score
0
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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top