The strange thing is that when I call the function in the beginning
Event.observe(window, 'load', init, false); function init() { manageCart('display', ''); } It works. The form submission also works. Only the add_item and remove_item functions that I call using onclick will cause the sidebar to disappear.
Hope someone who has JS knowledge can enlighten me on this.