I have a created a page which have a option two choose multiple row as per requirement but when i choose multiple row then mathematical calculation done for only last row, i am beginner for Java so can anyone help me out for this.
Please find my below asp code
<html>
<head>
<title>Dispatch Management System Developed by Duravit India Pvt Ltd, IT Department</title>
<LINK href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="jquery-ui-1.10.4.customNew.css">
<script src="jqueryNew-1.10.2.js"></script>
<script src="jqueryNew-ui-1.10.4.custom.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
$(function() {
$( "#datepicker1" ).datepicker();
});
$(function() {
$( "#datepicker2" ).datepicker();
});
</script>
<SCRIPT LANGUAGE="JavaScript">
function SpCharcheck(e) {
var num;
var char;
if (window.event)
{
num = e.keyCode
}
else if (e.which)
{
num = e.which
}
char = String.fromCharCode(num)
if (char == "<" ||char == ">" ||char == "'" || char == "`" || char == "?")
{
return false;
}
else {
return true;
}
}
</script>
<style>
.button
{
style:solid;
color:white;
font-weight:bold;
style=height:25px; width:200px;
}
</style>
<script type="text/javascript">
function change_case()
{
document.form1.type.value=document.form1.type.valu e.toLowerCase();
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body text=black>
<form name=my_cal action="Requisition.asp" method="post">
<br>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr align=left><th><FONT style=FONT-SIZE:12pt color=black>Enter DIND Project ref. No.: </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=dindprorefno> <input type=submit class="button" value='Get Details'><br><br></th>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Project Int. Ref. No : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=prorefno></th> <th><FONT style=FONT-SIZE:10pt color=black>Date of Proposal : </b></font></th><th><input type=text id=datepicker name=proposaldate></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Name of Project : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=proname></th> <th><FONT style=FONT-SIZE:10pt color=black>Offer Validity : </b></font></th><th><input type=text id=datepicker1 name=offvalidity></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Project Site : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=prosite></th> <th><FONT style=FONT-SIZE:10pt color=black>Price validity up to : </b></font></th><th><input type=text id=datepicker2 name=pricevalidity></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Invoice To : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=invoiceto></th> <th><FONT style=FONT-SIZE:10pt color=black>Sales responsible : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=salesres></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Project Partner : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=propartner></th> <th><FONT style=FONT-SIZE:10pt color=black>Cust Care Resp : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=ccres></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Categaory : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=cat></th> <th><FONT style=FONT-SIZE:10pt color=black>Payment Mode : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=paymentmode></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>No.of Bathrooms : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=bathno></th> <th><FONT style=FONT-SIZE:10pt color=black>Payment terms : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=paymentterms></th></tr>
<tr align=left><th><FONT style=FONT-SIZE:10pt color=black>Special Remark : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=sremarks></th> <th><FONT style=FONT-SIZE:10pt color=black>Delivery Schedule : </b></font></th><th><input type=text onkeypress="return SpCharcheck(event)" name=delsch></th></tr>
</table><br>
<b><FONT style=FONT-SIZE:10pt>
Select Line : </font> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<%
Dim i , sel , line
For i = 1 To 10
If CInt(Request.QueryString("Line")) = i Then
sel = "selected"
Else
sel = ""
End IF
%>
<option value="<%=Request.ServerVariables("SCRIPT_NAME")%> ?Line=<%=i%>"<%=sel%>><%=i%></option>
<%
Next
%>
</select><br><br>
<table width=100% border=5 cellpadding=2 cellspacing=2 FONT style=FONT-SIZE:8pt>
<tr>
<td><center><b>Product Code</b><center></td>
<td><center><b>Product Description</b><center></td>
<td><center><b>DIAS Rate</b><center></td>
<td><center><b>Disc on DIAS%</b></center></td>
<td><center><b>Net to DIND</b><center></td>
<td><center><div id="loginuser"><b>% of ORC</b><center><center><input type=text size=2 onkeypress="return SpCharcheck(event)" value = 2 name=horc></center></div></td>
<td><center><b>DIND invoice rate </b></center></td>
<td><center><b>CST / VAT</b></center><center><input type=text size=2 onkeypress="return SpCharcheck(event)" value = 5 name=hvat></center></td>
<td><center><b>Net</b></center></td>
<td><center><b>Octroi/ other</b><input type=text onkeypress="return SpCharcheck(event)" size=2 value= 0 name=hoctroi></center></td>
<td><center><b>Partner Landed</b></center></td>
<td><center><b> % of Mark up</b></center><center><input type=text size=2 onkeypress="return SpCharcheck(event)" value = 5 name=hmarkup></center></td>
<td><center><b>Project Price before VAT</b></center></td>
<td><center><b>Local VAT %</b><input type=text size=2 onkeypress="return SpCharcheck(event)" value = 14.5 name=hm></center></td>
<td><center><b>Project landed likely</b></center></td>
<td><center><b>Qty</b></center></td>
<td><center><b>Value</b></center></td>
<td><center><b>Disc to MRP</b></center></td>
<td><center><b>MRP-10</b></center></td>
<td><center><b>DIND PI value</b></center></td>
</font>
</tr>
<%
line = Request.QueryString("line")
IF line = "" Then
line = 1
End IF
session("line")=Request.QueryString("line")
session("i")=Request.QueryString("i")
For i = 1 To line
%>
<tr><center>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="procode<%=i%>"></td>
<td><center><input type=text size=15 onkeypress="return SpCharcheck(event)" name="prodesc<%=i%>"></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="diasrate<%=i%>"></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="diasdisc<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="netDIND<%=i%>" disabled=disabled></td>
<td><center><input type=text size=3 onkeypress="return SpCharcheck(event)" name="orc<%=i%>" disabled=disabled></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="invoicerate<%=i%>"></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="CVAT<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="net<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="octroi<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="partner<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="markup<%=i%>" disabled=disabled></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="projectprice<%=i%>" disabled=disabled></td>
<td><center><input type=text size=3 onkeypress="return SpCharcheck(event)" name="localvat<%=i%>" disabled=disabled></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="landed<%=i%>"></td>
<td><center><input type=text size=5 onkeypress="return SpCharcheck(event)" name="qty<%=i%>"></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="value<%=i%>" disabled=disabled></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="mrpdisc<%=i%>" disabled=disabled></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="mrp10<%=i%>"></td>
<td><center><input type=text size=8 onkeypress="return SpCharcheck(event)" name="pivalue<%=i%>" disabled=disabled></td></tr>
<script language="javascript" type="text/javascript">
function netdind(){
a=Number(document.my_cal.horc.value);
b=Number(document.my_cal.hvat.value);
c=Number(document.my_cal.hmarkup.value);
d=Number(document.my_cal.hm.value);
e=Number(document.my_cal.hoctroi.value);
f=Number(document.my_cal.diasrate<%=i%>.value);
g=Number(document.my_cal.invoicerate<%=i%>.value);
h=(g*100/(100+a));
h=h.toFixed(0);
document.my_cal.netDIND<%=i%>.value=h;
i1-(h/f))* 100);
i=i.toFixed(0)+'%';
document.my_cal.diasdisc<%=i%>.value=i;
}
</script>
<%
Next
%>
<script>
//call after page loaded
window.onload=netdind;
</script>
</table><br>
<center> <input type="button" value="NetDIND" onclick="javascript:netdind();"> <input type="hidden" name="hdnLine" value="<%=i-1%>"> <INPUT class="button" Type="button" VALUE="Back" onclick="window.location.href='callmain.asp'"></center>
<pre>
</form>
</body>
</html>