[ic] On the fly item quantity change?

Jerry jerry@digitalfm.com
Wed, 13 Dec 2000 17:02:39 -0500


Anyone now how, assuming it's possible, to change an
item quantity, inside an item-list loop, via calculation
and still get the item-subtotal correct? I've got it
changing so that the correct value comes up in the item-quantity
field, but then it requires a refresh to recalculate the 
subtotals? Is it possible to do this in one loop?
Here's the code somewhat simplified. If you order less than
10, the quantity changes to 10 and shows in the item-quantity
field. But it then requires a refresh to get the subutotals to
catch up. I could just tell the user to refresh but it would
be nicer to just have it done for them.

[item-calc]
my $q = q{[item-quantity]};
if($q < 10) {
return <<EOF;
<INPUT TYPE=text NAME="[quantity-name]" VALUE=$q SIZE=3>
EOF
}
else {
return <<EOF;
</TD><TD ALIGN=CENTER>
<INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
EOF
}
[/item-calc]

Thanks Jerry