I have the solution : use directily prototype Ajax obcjet.
$javascriptchange = new Ajax.Updater('colpanier','/photoweb//basket/
view/35', {asynchronous:true, evalScripts:true,
parameters:Form.serialize(Event.element(event).form), requestHeaders:
['X-Update', 'colbasket']}) ;
I use ajax and it work very well.
form name=basket id=panier method=POST action=?php echo $html-
url('/basket/view')?
?php echo $ajax-submit('Save', array('update' = 'divbasket')); ?
I need to submit my form with ajax every time a change is used in a
select tag.
$javascriptchange =
How can i have a calculated attribut in a model.
My example : i hava a shopping_cart_product with 2 attributs :
quantity and Unit_price and i want a calculated_price witch is
quantity*Unit_price (without store it in database)
Can I try an afterFind function ?
How can i have a calculated attribut in a model.
My example : i hava a shopping_cart_product with 2 attributs :
quantity and Unit_price and i want a calculated_price witch is
quantity*Unit_price (without store it in database)
Can I try an afterFind function ?
Or
[code]
foreach ($params['data']['Basketline'] as $Basketline) {
echo $html-input(Backet/Basketline[$i]/quantite,
array('size'='4'));
[/code]
Doesn't work too ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
I have a basket with many lines. I want to display all the line in a
form. User can update the quantite of each line.
How can i code my view ?
I tryed
[code]
foreach ($params['data']['Basketline'] as $Basketline) {
echo $html-input(Basketline/$i/quantite, array('size'='4'))
If i have a simple attribut i can use Using $html-input('Model/
fieldname')
I have a hasmany attribut names hasmanyfieldname, and i want to
update each row of this attribut in a single form.
can i used the $htmlhelper ?
foreach ($params['data']['hasmanyfieldname'] as $key=$val) {
echo
I have a model witch use a hasAndBelongsToMany collection
class User extends AppModel
{
var $hasAndBelongsToMany = array(
'Photo' = array('className' = 'Photo',
'joinTable' = 'photo_users',
'associationForeignKey' = 'User_id',
'foreignKey' = 'Photo_id',
'unique' =