J
Jagdeesh
Hai,
I have the following table as HTML file...........
<table align="center" width="600" cellpadding="10" cellspacing="10">
<tr>
<td>
<form action="/mbis/actions/order_confirm.jsp"
method="#default"><table align="center" width="600" cellpadding="1"
cellspacing="1">
<tr>
<td align="center" class="head"><strong>Description</strong></td>
<td align="center" class="head"><strong>Item Number</strong></td>
<td align="center" class="head"><strong>Price</strong></td>
<td align="center" class="head"><strong>Wanted Price</strong></td>
<td align="center" class="head"><strong>Quantity</strong></td>
</tr>
<tr>
<td class="stotal">Scanner</td>
<td class="stotal" align="center">105</td>
<td class="stotal" align="right">€ 200.00</td>
<td class="stotal" align="center"><input type="text" name="want"
value="0" size="4"></td>
<td class="stotal" align="center"><input type="text"
name="105|Scanner|200.00" value="0" size="4"></td>
</tr>
<tr>
<td colspan="4" align="center"><input type="submit" value="Place
Order"></td></tr></table></form></td></tr>
</table>
This HTML is then linked to order_confirm.jsp which retrieves the
values "want" and "Quantity" which has the following structure:
<table align="center" width="600" cellpadding="10" cellspacing="10">
<tr>
<td>
<form action="/mbis/actions/order_send.jsp"><table
align="center" width="600" cellspacing="1" cellpadding="1">
<tr>
<td align="center" class="head"><strong>Item Number</strong></td>
<td align="center" class="head"><strong>Description</strong></td>
<td align="center" class="head"><strong>Price</strong></td>
<td align="center" class="head"><strong>Wanted Price</strong></td>
<td align="center" class="head"><strong>Quantity</strong></td>
<td align="right" class="head"><strong>ActualRatetotal</strong></td>
</tr>
<%
float stotal = 0;
float gtotal = 0;
DecimalFormat df = new DecimalFormat("#.##");
for (Enumeration e = request.getParameterNames();e.hasMoreElements()
{
Object name = e.nextElement();
int wantpr = Integer.parseInt(request.getParameter("want"));
int qty = Integer.parseInt(request.getParameter((String)name));
if(!(qty > 0)) { continue; }
StringTokenizer st = new StringTokenizer((String)name,"|");
String part_no = st.nextToken();
String desc = st.nextToken();
float price = Float.parseFloat(st.nextToken());
%>
<input type="hidden" name="<%= part_no + "|" + desc + "|" + price
%>" value="<%= qty %>">
<tr>
<td class="stotal"><%= part_no %></td>
<td class="stotal"><%= desc %></td>
<td class="stotal" align="right">€ <%= df.format(price) %></td>
<td class="stotal" align="center"><%= wantpr %></td>
<td class="stotal" align="center"><%= qty %></td>
<% stotal = qty*price;gtotal += stotal; %>
<td class="stotal" align="right">€ <%= df.format(stotal) %></td>
</tr>
<%
}
%>
<tr><td class="gtotal" colspan="5"
align="right"><strong>TOTAL</strong></td><td class="gtotal"
align="right">€ <%= df.format(gtotal)
%></td></tr></table></td></tr></table>
<table align="center">
<tr>
<td>
<%
if(gtotal > 0) {
%>
<input type="submit" value="Confirm"></form></td><td>
<form action="/mbis/catalog.htm">
<input type="submit" value="Cancel"></form>
<% } else { %>
</form><div align="center"><strong>You haven't ordered
anything</strong></div>
<% } %>
</td></tr></table>
But, the problem is when i give the values for the parameters
"Quantity" and "Wanted Price" , only the parameter "Quantity" is
mapped to this JSP file but not the "Wanted Price" parameter. Can any
one find the problem and give me a solution?
Waiting for your valuable reply.
Regards,
Jagdeesh
I have the following table as HTML file...........
<table align="center" width="600" cellpadding="10" cellspacing="10">
<tr>
<td>
<form action="/mbis/actions/order_confirm.jsp"
method="#default"><table align="center" width="600" cellpadding="1"
cellspacing="1">
<tr>
<td align="center" class="head"><strong>Description</strong></td>
<td align="center" class="head"><strong>Item Number</strong></td>
<td align="center" class="head"><strong>Price</strong></td>
<td align="center" class="head"><strong>Wanted Price</strong></td>
<td align="center" class="head"><strong>Quantity</strong></td>
</tr>
<tr>
<td class="stotal">Scanner</td>
<td class="stotal" align="center">105</td>
<td class="stotal" align="right">€ 200.00</td>
<td class="stotal" align="center"><input type="text" name="want"
value="0" size="4"></td>
<td class="stotal" align="center"><input type="text"
name="105|Scanner|200.00" value="0" size="4"></td>
</tr>
<tr>
<td colspan="4" align="center"><input type="submit" value="Place
Order"></td></tr></table></form></td></tr>
</table>
This HTML is then linked to order_confirm.jsp which retrieves the
values "want" and "Quantity" which has the following structure:
<table align="center" width="600" cellpadding="10" cellspacing="10">
<tr>
<td>
<form action="/mbis/actions/order_send.jsp"><table
align="center" width="600" cellspacing="1" cellpadding="1">
<tr>
<td align="center" class="head"><strong>Item Number</strong></td>
<td align="center" class="head"><strong>Description</strong></td>
<td align="center" class="head"><strong>Price</strong></td>
<td align="center" class="head"><strong>Wanted Price</strong></td>
<td align="center" class="head"><strong>Quantity</strong></td>
<td align="right" class="head"><strong>ActualRatetotal</strong></td>
</tr>
<%
float stotal = 0;
float gtotal = 0;
DecimalFormat df = new DecimalFormat("#.##");
for (Enumeration e = request.getParameterNames();e.hasMoreElements()
{
Object name = e.nextElement();
int wantpr = Integer.parseInt(request.getParameter("want"));
int qty = Integer.parseInt(request.getParameter((String)name));
if(!(qty > 0)) { continue; }
StringTokenizer st = new StringTokenizer((String)name,"|");
String part_no = st.nextToken();
String desc = st.nextToken();
float price = Float.parseFloat(st.nextToken());
%>
<input type="hidden" name="<%= part_no + "|" + desc + "|" + price
%>" value="<%= qty %>">
<tr>
<td class="stotal"><%= part_no %></td>
<td class="stotal"><%= desc %></td>
<td class="stotal" align="right">€ <%= df.format(price) %></td>
<td class="stotal" align="center"><%= wantpr %></td>
<td class="stotal" align="center"><%= qty %></td>
<% stotal = qty*price;gtotal += stotal; %>
<td class="stotal" align="right">€ <%= df.format(stotal) %></td>
</tr>
<%
}
%>
<tr><td class="gtotal" colspan="5"
align="right"><strong>TOTAL</strong></td><td class="gtotal"
align="right">€ <%= df.format(gtotal)
%></td></tr></table></td></tr></table>
<table align="center">
<tr>
<td>
<%
if(gtotal > 0) {
%>
<input type="submit" value="Confirm"></form></td><td>
<form action="/mbis/catalog.htm">
<input type="submit" value="Cancel"></form>
<% } else { %>
</form><div align="center"><strong>You haven't ordered
anything</strong></div>
<% } %>
</td></tr></table>
But, the problem is when i give the values for the parameters
"Quantity" and "Wanted Price" , only the parameter "Quantity" is
mapped to this JSP file but not the "Wanted Price" parameter. Can any
one find the problem and give me a solution?
Waiting for your valuable reply.
Regards,
Jagdeesh