Announcement

Collapse
No announcement yet.

products add to cart when extended info clicked

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    products add to cart when extended info clicked

    Hi,

    i was following this post 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

    #2
    You are using the following for the Enlarge Image button
    Code:
    <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)
    Code:
    <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.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment

    Working...
    X