Hi all,

I did a search on onComplete here and on Google but didn't find the
answer to what is probably a simple enough problem to resolve for
someone who uses javascript/prototype more than me.

I am creating a shopping cart and I'm using form.request() when adding
a product to the cart which is working really well including the
addition of various options for each product.

However once I have added each item I want to update the Cart Overview
from "You have no items in your cart" to "You have XX items totalling
£XX.XX in your cart".

I am using the following which is doing as it should but a bit too
fast:

onClick=\"$('shopCartAdd').request({
  onComplete: updater({container: 'shopCartOverview', action:
'shopCartUpdate'})
});\"

but the onComplete is firing before my php script has updated the cart
table so it simply refreshes the overview content rather than updating
it with the new product count and total.

I have tried using onSuccess as well but I am assuming AJAX deems
getting a connection to the script as a success so ploughs on at
lightening speed.  Anyway of stopping the onComplete/onSuccess from
firing until my php script has done it's thing with the form data?

Paul.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to