note 55533 rejected from langref by vincent
| From: | vincent@php.net | Date: | Sat, 06 Aug 2005 07:33:54 +0000 |
| Subject: | note 55533 rejected from langref by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93157@lists.php.net to get a copy of this message | ||
Note Submitter: xxxRHEIGNxxx at yahoo dot com
----
Im creating a program that compute the total amount by multiplying the qty to the price..that sounds
easy but the problem is...i "echo" the the names of the fileds so that i can add as many
rows as i want, but i limit it to ten...the program looks like this....
<?php
echo "<table width=10%><tr><td align='center'>QTY</td><td
align='center'>PRICE</td><td align =
'center'>AMOUNT</td></tr>";
$trow = $raw+$raaw;
if ($trow < 10){
for ($i=0; $i<=$raw+$raaw; $i++) {
$a = $i + 1;
echo "<tr>
<td width='1%' height='2' align='center'
bgcolor='#FFFFFF' align='left'><input type='text'
name='qty[$i]' style='text-align: Center' size='5' maxlength=4
onfocus='FocusIn(this); startCalc()' onblur='FocusOut(this); stopCalc();
javascript:document.form1.um.focus()' onkeyup='FilterNonNumeric(this)'
value='";
echo $qty[$i];
echo "' ></td>";
echo "<td width='1%' height='2' align='center'
bgcolor='#FFFFFF' align='left'><input type='text'
name='unitprice[$i]' style='text-align: Center' size='10' maxlength=9
onfocus='FocusIn(this); startCalc()' onblur='FocusOut(this); stopCalc();
javascript:document.form1.sys_id.focus()' onkeyup='FilterNonNumeric(this)'
value='";
echo $unitprice[$i];
echo "'></td><td width='24%' height='2'
align='left' bgcolor='#FFFFFF' align='left'><input
type='text' name='amount[$i]' style='text-align: Center'
size='10' maxlength=9 onfocus='FocusIn(this);'
onblur='FocusOut(this);' value='";
echo $amount[$i];
echo "'></td><tr>";
}
}else{
echo "<b>Unable to comply...Too many rows inserted!</b>\n";
echo "<b>Limit is only 10...Sorry!</b>\n";
echo "<b>Click <a href='f.php'>here</a> to new
form.</b>";
}
echo "</table><br>";
// this is to see wat's going in the values of the fields
$tqty = array($i => $qty);
print_r ($tqty);
echo "<br>";
$unit = array ($i => $unitprice);
print_r ($unit);
echo "<br>";
$amt = array ($i => $amount);
print_r ($amt);
echo "<br>";
echo "<br>";
?>
so any one pls.. give me an idea how can i give the amount in each row by multiplying the qty and
price on that specific row...pls send me your contribution....at xxxRHEIGNxxx@yahoo.com...thx for
help....