I am asking for help again,

I have while loop, and i wish to have every checkbox with 
different(correct) value in checkPrice

$co=0;
while (ocifetchinto($stmt,$row, OCI_ASSOC))     {
          $co++;
          $name = $row['EQTTEXT'];
          $price  = $row['ADDPRICE1'];

       $form->test -> addMultiOption("$co","$name")
                         -> setAttrib('onchange',"checkPrice($price);");
}

but this give me in all attrib onchange, checkPrice(50);
50-is the last price, of product in the table.

      EQTTEXT          ADDPRICE1
1    Keyless-Go       150
2    Door                241
2    wifi                  89
....
100 something        50



<input type="checkbox" name="test[]" value="1"
onchange="checkPrice(50);">Keyless-Go

<input type="checkbox" name="test[]" value="2"
onchange="checkPrice(50);">Door

<input type="checkbox" name="test[]" value="3"
onchange="checkPrice(50);">wifi 
.
....

it must be

<input type="checkbox" name="test[]" value="1"
onchange="checkPrice(150);">Keyless-Go

<input type="checkbox" name="test[]" value="2"
onchange="checkPrice(241);">Door

<input type="checkbox" name="test[]" value="3"
onchange="checkPrice(89);">wifi 

Thanks,
Lp Robert

-- 
View this message in context: 
http://www.nabble.com/Multicheckbox-and-setAttrib---for-every-checkbox-tp18275856p18275856.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to