I am using Visual Studios Web Express. I have a webform with an order form type thing.. name, address, city, state.. a drop down to select an item and a drop down to select the price. Each item has a different price. How do I after display the total price (multiply quantity by items price) when the submit button is pressed and the form validates? I have included my code below.
<head id="Head1" runat="server">
<title>Validation</title>
<style type="text/css">
.style1
{
font-size: xx-large;
font-weight: bold;
}
.style2
{
font-size: large;
}
</style>
</head>
<body bgcolor="#99ff99">
<form id="form1" runat="server">
<div class="style1" style="text-align: center">
FidgetWitMe</div>
<p class="style2" style="text-align: center">
"...Occupy your hands to free your mind..."</p>
<p>
Please Select an Item to Purchase:</p>
<table>
<tr>
<td>
Item:</td>
<td>
</td>
<td>
Quantity</td>
<td>
</td>
<td>
Price Each</td>
</tr>
<tr>
<td>
<asp
ropDownList ID="itemdrop" runat="server" AutoPostBack="True">
<asp:ListItem Value="Select">Select Item</asp:ListItem>
<asp:ListItem Value="Stress Ball">Stress Ball</asp:ListItem>
<asp:ListItem Value="Spinner Ring">Spinner Ring</asp:ListItem>
<asp:ListItem Value="Rubic Cube">Rubic Cube</asp:ListItem>
<asp:ListItem Value="Pencil/Pen Foam Grips">Pen/Pencil Foam Grips</asp:ListItem>
<asp:ListItem Value="Pack of Cards">Pack of Cards</asp:ListItem>
</asp
ropDownList>
</td>
<td>
</td>
<td>
<asp
ropDownList ID="quantitydrop" runat="server">
<asp:ListItem Selected="True">Quantity</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp
ropDownList>
</td>
<td>
</td>
<td style="text-align: center">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
</tr>
</table>
<p>
Please Enter Your Customer Information:</p>
<table>
<tr>
<td>
Name</td>
<td>
<asp:TextBox ID="name" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="name" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
Address</td>
<td>
<asp:TextBox ID="addy" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="addy" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
City</td>
<td>
<asp:TextBox ID="city" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="city" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
State</td>
<td>
<asp:TextBox ID="state" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="state" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
Zip</td>
<td>
<asp:TextBox ID="zip" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="zip" ErrorMessage="RequiredFieldValidator">R<...
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="zip" ErrorMessage="RegularExpressionValidator...
ValidationExpression="\d{5}(-\d{4})?"></...
</td>
</tr>
<tr>
<td>
Phone Number</td>
<td>
<asp:TextBox ID="phone" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ControlToValidate="phone" ErrorMessage="RequiredFieldValidator">R<...
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="phone" ErrorMessage="RegularExpressionValidator...
ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularE...
</td>
</tr>
</table>
<p>
<asp:Button ID="Button1" runat="server" Text="Order Summary" />
</p>
<p>
<asp:Button ID="Button2" runat="server" Text="Confirm Order" />
<asp:Label ID="Label2" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label3" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label4" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label5" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label6" runat="server"></asp:Label>
</p>
</form>
</body>
</html>
Category
Computers & Internet > Software
<head id="Head1" runat="server">
<title>Validation</title>
<style type="text/css">
.style1
{
font-size: xx-large;
font-weight: bold;
}
.style2
{
font-size: large;
}
</style>
</head>
<body bgcolor="#99ff99">
<form id="form1" runat="server">
<div class="style1" style="text-align: center">
FidgetWitMe</div>
<p class="style2" style="text-align: center">
"...Occupy your hands to free your mind..."</p>
<p>
Please Select an Item to Purchase:</p>
<table>
<tr>
<td>
Item:</td>
<td>
</td>
<td>
Quantity</td>
<td>
</td>
<td>
Price Each</td>
</tr>
<tr>
<td>
<asp

<asp:ListItem Value="Select">Select Item</asp:ListItem>
<asp:ListItem Value="Stress Ball">Stress Ball</asp:ListItem>
<asp:ListItem Value="Spinner Ring">Spinner Ring</asp:ListItem>
<asp:ListItem Value="Rubic Cube">Rubic Cube</asp:ListItem>
<asp:ListItem Value="Pencil/Pen Foam Grips">Pen/Pencil Foam Grips</asp:ListItem>
<asp:ListItem Value="Pack of Cards">Pack of Cards</asp:ListItem>
</asp

</td>
<td>
</td>
<td>
<asp

<asp:ListItem Selected="True">Quantity</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp

</td>
<td>
</td>
<td style="text-align: center">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
</tr>
</table>
<p>
Please Enter Your Customer Information:</p>
<table>
<tr>
<td>
Name</td>
<td>
<asp:TextBox ID="name" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="name" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
Address</td>
<td>
<asp:TextBox ID="addy" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="addy" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
City</td>
<td>
<asp:TextBox ID="city" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="city" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
State</td>
<td>
<asp:TextBox ID="state" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="state" ErrorMessage="RequiredFieldValidator">R<...
</td>
</tr>
<tr>
<td>
Zip</td>
<td>
<asp:TextBox ID="zip" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="zip" ErrorMessage="RequiredFieldValidator">R<...
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="zip" ErrorMessage="RegularExpressionValidator...
ValidationExpression="\d{5}(-\d{4})?"></...
</td>
</tr>
<tr>
<td>
Phone Number</td>
<td>
<asp:TextBox ID="phone" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ControlToValidate="phone" ErrorMessage="RequiredFieldValidator">R<...
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="phone" ErrorMessage="RegularExpressionValidator...
ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"></asp:RegularE...
</td>
</tr>
</table>
<p>
<asp:Button ID="Button1" runat="server" Text="Order Summary" />
</p>
<p>
<asp:Button ID="Button2" runat="server" Text="Confirm Order" />
<asp:Label ID="Label2" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label3" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label4" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label5" runat="server"></asp:Label>
</p>
<p>
<asp:Label ID="Label6" runat="server"></asp:Label>
</p>
</form>
</body>
</html>
Category
Computers & Internet > Software