Jump to content

Problem in IE with a javascript form submissions


refiking

Recommended Posts

So, here's the issue. I have an add to cart link at the top of the page that submits a form toward the end of the page.  It works in FF, but not IE.  What am I doing wrong here?

 

Here is the link:

<a href="Javascript:document.addtocart.submit();" style="text-decoration:none;"><button style="background-color:#3355CA; color:#FFFFFF; font-weight:bold; font-size:12px; padding-bottom:2px;">Add To Cart</button></a>

 

Link to comment
Share on other sites

That won't work Mr. LOL, there are about 25 forms between the add to cart link and the addtocart form itself

 

<sarcasm>Oh sorry, I didn't notice that in your very detailed description of your problem</sarcasm>

 

Try that:

 

<button onclick="document.addtocart.submit()" style="background-color:#3355CA; color:#FFFFFF; font-weight:bold; font-size:12px; padding-bottom:2px;">Add To Cart</button>

Link to comment
Share on other sites

Got it working from another forum, but here is the answer if anyone else needs it:

 

<button style="background-color:#3355CA; color:#FFFFFF; font-weight:bold; font-size:12px; padding-bottom:2px;" onclick="Javascript:document.addtocart.submit();">Add To Cart</button>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.