Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   1st Drop-down selection determins selected value in all drop-downs In ASP.Net Wizard (http://www.velocityreviews.com/forums/t747569-1st-drop-down-selection-determins-selected-value-in-all-drop-downs-in-asp-net-wizard.html)

jaysch 04-30-2011 02:19 PM

1st Drop-down selection determins selected value in all drop-downs In ASP.Net Wizard
 
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!


All times are GMT. The time now is 07:07 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57