Hello,

I need to use aac with radio buttons, but it doesn't work.
I'm using Drupal 5.12 + Ubercart 5.x-1.6 + AAC 1.5 (downloaded from drupal.org).
It doesn't work with IE, Firefox 3 and Safari (under Windows). However, due to FF form status caching, when I select a radio button and reload the page, the correct price is calculated after the page is fully loaded (and the radio button still selected).

Thanks

Comments

cyu’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have Jquery update installed? I believe UC_AAC 1.5 requires it, but grabbing the latest dev snapshot gets rid of that requirement (which I didn't realize existed at the time I made the release).

minsky’s picture

Yes, I installed that. Meanwhile I discovered that the function perform_ajax_calculation_XYZ() is not called on radiobutton onclick event. If I call it manually from the address bar, everything gets set.

cyu’s picture

Does it work with select box attributes but not radio button? If neither are working, you should check to make sure your template has a div surrounding the node in the format noted on the project page.

minsky’s picture

Yes, it works with select boxes but not with radio buttons

cyu’s picture

mim81: Can you tell why

$("#node-'. $nid .' :radio").each(function () {
  var element = this;
  if (element.name && element.name.match("attributes")) {
    $(this).unbind("click.uc_aac");
    $(this).bind("click.uc_aac", function () {
      perform_ajax_calculation_'. $nid .'();
    });
  }
});

is not binding to onclick of your radio buttons in the initialize_fields_$nid() function? It should find any radio buttons within node-$nid div (which must exist if your select attributes are working), and append to any radio buttons with "attributes" in their name. Are you getting any JS errors?

minsky’s picture

I don't know why it's not binding, but I found that it is working with the following modification:

          $(this).unbind("click");
          $(this).bind("click", function () {
            perform_ajax_calculation_237();
          });
cyu’s picture

mim81: That is the change that is put in place in the dev version which removes namespaced binding. What version of Jquery update do you have running and have you placed all of the .js files into the /misc folder? If you have, then the original code should have worked.

minsky’s picture

My mistake, I should have double checked: I had installed JQuery 1.0 instead of 2.0. I upgraded and it worked.
Thanks and sorry for losing your time!

cyu’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No prob, that is useful information...I was unaware that it did not work with the 1.0 branch. I'll add it to the project page.