Hey,
I have an form that submits via ajax. It works fine except it always
submits two identical queries. I have tried formatting it and testing
with firebug and safari. Here is the code and below if the browser
output.

<?php
    echo $ajax->Form(array(
    'type' => 'post',
    'options' => array(
        'model'=>'Cart',
        'update'=>'update',
        'indicator' => 'loading',
        'before' => '$("#update").html("Adding... Please wait a
moment...");',
        'url' => array(
            'controller' => 'galleries',
            'action' => 'add_to_cart'
        ))));
        echo $this->Form->hidden('photo_id');
        echo $this->Form-
>input('product_id',array('onChange'=>'changeDescription(this.value);'));
        echo '<div class="status" id="update"></div>';
        echo $this->Form->end('Add to Cart');
?>

Firebug outputs:
POST https://xxxxxxxxxxxxxxx.com/galleries/add_to_cart 200 OK 107ms
jquery....min.js (line 141)
POST https://xxxxxxxxxxxxxxx.com.com/galleries/add_to_cart 200 OK
120ms jquery....min.js (line 141)

The reason that I am trying to fix this is because I am getting the
item added to the cart twice, sometimes. Driving me nuts. Any help
would be appreciated!!!!!!!!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to