sale form in php with autoincrement rows with calculation
hi i am new to web developing and i am working on a project which has a sale form with autoincrement rows with calculation part in it ,
the problem is when i execute it in browser the calculation part works for the first row
here's my code which can help u in understanding much better
$(function(){
// sets the click function to everything with a class of add-field, this is useful if you want multiple add buttons such as plus signs
$(".add-field").click(function(){
// selects everything with a value of foo for the name attribute and adds the input after that selection
$("input[id='srno'][type='text'][name='srno']").after('<br /><input name="srno" type="text" size="4"/>');
$("input[id='itemcode'][name='itemcode']").after('<br /><input name="itemcode" type="text" size="6" />');
$("input[id='itemname'][name='itemname']").after('<br /><input name="itemname" type="text" size="35" />');
$("input[id='qty'][name='qty'][onblur='calculateText()']").after('<br /><input type="text" id="qty" name="qty" size="3" onblur="calculateText()" />');
$("input[id='rate'][name='rate'][onblur='calculateText()']").after('<br /><input type="text" id="rate" name="rate" onblur="calculateText()" size="6"/>');
$("input[id='amount'][name='amount'][onblur='calculateText()']").after('<br /><input type="text" id="amount" name="amount" onblur="calculateText()" readonly="readonly" size="8"/>');
return false;
});
});
</script>
</head>
<body>
<center><b><font size="4" color="green">SALE FORM</b></font></center>
<form name="sale" action="" method="Post">
<table align="center" width="750" Border="0px">
<tr>
<input type="hidden" name="vouchno" value=""/>
</tr>
<tr>
<td align="left">Party Name</td><td align="left"><select name="cmbname" style ="width:50% ;" tabindex="1"/>
<option value=""></option>
<?php
mysql_connect("localhost","root",'')or die(mysql_error());
mysql_select_db("customer") or die(mysql_error());
$result = mysql_query("SELECT DISTINCT `name` from `customer` order by accode") or die(mysql_error());
Bookmarks