Announcement

Collapse
No announcement yet.

Issue with form button as an image on new design

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

  • Issue with form button as an image on new design

    Hello Everyone,
    I am currently in the middle of moving our site to 3dcart and I am working on upgrading our design a bit and getting the look just right.I've removed the standard form button with mouseovers to an image but now that Ive done that instead of the make an offer button just taking you to the popup to make the offer it is also submits the product to the cart like if you pressed the add to cart button.

    Can anyone tell me what the heck I did wrong. Its been a long time since I had to dive into coding stuff and clearly Im rusty.

    http://fitnessfactoryoutlet-com.3dca...Cage_p_14.html

    thanks for the help. Comments on the design are welcome as well.

    Troy

  • #2
    The problem is that you're using an <input type="img"> element which is essentially a form submit button. When you click on the button, it is firing its onclick event properly, but it is also submitting the form, which incidentally feeds the user into add_cart.asp. That's why both events are happening. If you don't want to get too involved with the code, the easiest solution is to replace

    HTML Code:
    <div id="Div2">
        <input name="makeonoffer" onclick="javascript:popup('makeanoffer.asp?action=newOffer&catalogid=14 ',640,410,false);" src=
        "http://fitnessfactoryoutlet-com.3dcartstores.com/assets/images/checkout_make_an_offer.gif" type="image" value="Make an Offer">
    </div>

    with:

    HTML Code:
    <div id="Div2">
        <a href="javascript:void(0)" onclick="javascript:popup('makeanoffer.asp?action=newOffer&catalogid=14 ',640,410,false);">
            <img src= "http://fitnessfactoryoutlet-com.3dcartstores.com/assets/images/checkout_make_an_offer.gif" alt="Make an Offer">
        </a>
    </div>

    Edited: I should note that the above code isn't just going to be a simple cut/paste into your template file. If you need further instruction, find the corresponding code within your template file (the <div id="Div2"> ... </div> part) and paste it into a reply
    Last edited by mlopez99; 07-31-2015, 02:12 PM.

    Comment


    • #3
      Thank you miopez99...worked perfectly:)

      Comment

      Working...
      X