i can do:
$tprice=100;
while (ocifetchinto($stmt,$row, OCI_ASSOC)) {
$modpric[$row['ADDPRICE1']]=$row['EQTTEXT'];
}
$form->test -> setMultiOptions($modpric)
-> setAttrib('onchange',"checkPrice($tprice);"); //i
give
total price which is the same for all at start
and then in javascript:
function checkPrice(tprice) {
var x=document.getElementsByName("test[]");
for(var i=0;i<x.length;i++) {
if (x[i].checked) {
vrdod=x[i].value;
tprice=parseFloat(tprice) + parseFloat(vrdod);
}
}
document.getElementById('totalPrice').value=tprice;
}
but there is the problem
if i have 2 or more products with the same price, it wil display only one of
this with same price
EQTTEXT ADDPRICE1
1 Keyless-Go 150
2 Door 241
3 wifi 89
4 keyfor 150
5 book 89
....
100 something 50
Then i get just
<input type="checkbox" name="test[]" value="150"
onchange="checkPrice(100);">keyfor
<input type="checkbox" name="test[]" value="241"
onchange="checkPrice(100);">Door
<input type="checkbox" name="test[]" value="89"
onchange="checkPrice(100);">book
missing Keyless-Go, wifi
--
View this message in context:
http://www.nabble.com/Multicheckbox-and-setAttrib---for-every-checkbox-tp18275856p18276429.html
Sent from the Zend Framework mailing list archive at Nabble.com.