PDA

View Full Version : products add to cart when extended info clicked


webmaster
04-Mar-2008, 10:10 AM
Hi,

i was following this post Stop Popup Refresh (http://community.actinic.com/showthread.php?t=13187&highlight=stop+popup+refresh)

to remove the refresh from the primary page when you click the popup button.....however when i implement this by clicking my popup button a product gets added to the cart....not the one i click on but one furthe down.

however my onload is not called in the body tag its called in a script so thats where i put it.

does anyone know of any reason why this mite happen.

heres the page.....site.....try clicking on a popup button and you see what i mean.

http://www.happybeavers.co.uk/acatalog/Stockings.html

NormanRouxel
04-Mar-2008, 10:33 AM
You are using the following for the Enlarge Image button<INPUT TYPE="IMAGE"
VALUE="More..."
NAME="INFO_ST001"
onClick="javascript:ShowPopUp('info%5fST001%2ehtml',400,350);"
src="enlarge1.gif"
onmouseover="src='enlarge2.gif'"
onmouseout="src='enlarge1.gif'"
style="margin-top:8PX;"
/>
However an INPUT TYPE="IMAGE" defines a submit button for the product form, so that's why an add to cart is happening.

You could try adding return false; to the end of the onclick="..." call. This should inhibit the add to cart.

ALternatively and cleaner, use an IMG tag instead. I.e. (untested)<img src="enlarge1.gif"
onmouseover="this.src='enlarge2.gif'"
onmouseout="this.src='enlarge1.gif'"
onClick="ShowPopUp('info%5fST001%2ehtml',400,350);"
style="cursor:pointer; margin-top:8PX;"
/>Note that I've also corrected the JavaScript. You should use this.src and you don't need Javascript: in the onclick event code.