4 / 4
Jun 2009

I have set the 'contuinue shopping' button with my own background image (using jquery). The check boxes on the shopping cart have an onchange event which changes the background-color and removes my image. I have tried to unbind the event with



<code>

jQuery("input#remove_array[0]").unbind();

</code>



I'm not sure if this is the correct usage as I relatively new to jquery but it seems like it would do the trick. I have also tried a number of alteration on this such as



<code>

jQuery("#remove_array[0]").unbind();

</code>



<code>

jQuery("input").unbind("change");

</code>



The list goes on. I tried a load of different statements - for a couple of fun filled hours on the firebug console;-)

  • created

    Oct '08
  • last reply

    Jun '09
  • 3

    replies

  • 1.8k

    views

  • 2

    users

  • 1

    link

It is this code on the check box that is causing the issue:



<code>

onchange="document.getElementById('btnUpdtCart').style.background='#FFFF99';"

</code>



All of the above refers to code put in to the checkout button (between the script tags) - the 'EJEJC_shown' function.

8 days later

This has been resolved.



The following code will remove the event:



<code>

jQuery("input:checkbox").attr("onchange" , "");

</code>



The "input:checkbox" targets all of the check boxes and "attr" manipulates the onchange attribute.

7 months later

Thanks for posting this! I was having a similar issue and solved it by kind of hacking the code, so it's good to see a different and much cleaner way to solve this issue!



Best,

Amy T



1http://www.zippycart.com1 - Find and Compare Shopping Carts Online