I've searched all over and can't figure out the right/best way to do
this. I'm tearing apart the mootools demo for the contact form. What
I'm doing is setting up a checkout form for a shopping cart. When the
user selects a shipping method it updates the total.

1st attempt I tried wiping two cells of a table and replacing them w/
the php output, but that doesn't work too well.

2nd attempt what I think is probably better is to target two different
elements to update. One being the shipping rate and two being the
total amount of the cart. Here's what I'm thinking, but I'm not sure
how to pull a specific variable from the php file and convert it to
the javascript .. I'm pretty sure this isn't possible, but I'm new to
this.

this.set('send', {onComplete: function(response) {
                        log.removeClass('ajax-loading');
                        log.set('html', response); // this would be the 
shipping rate
selected
                        //ctotal.set('html', 
parseInt(subtotal)+parseInt(response));//
works, but you need to get the value of the current cart total not the
total from the id element .. may not work
                        ctotal.set('html', test); // test being a $test = 
"whatever";
variable from the php file
                }});

Any help is greatly appreciated. Thanks.

Reply via email to