X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   ajax add to cart button (https://forum.x-cart.com/showthread.php?t=64837)

xcartukguy 09-26-2012 12:12 AM

Re: ajax add to cart button
 
Quote:

Originally Posted by Brett Forsyth
I am having a similar issue. What class where you missing?


Code:

<div class="details">
<form name="formname">
<input type="submit" onclick="!ajax.widgets.add2cart(formname)" value="Buy" />
OR
<a href="#"  onclick="!ajax.widgets.add2cart(formname)">Buy</a>
</form>
</div>


That worked for me but the button only works once; I need to find out how to reset it.

I suggest the input though so you've got a fallback for non-javascript useability.

Brett Forsyth 09-26-2012 10:13 AM

Re: ajax add to cart button
 
Was there JS files you were missing though? I have been through everything and can't seem to find anything missing. The code is the same as the default theme but I can't get it to stop reloading the page.

totaltec 09-26-2012 10:17 AM

Re: ajax add to cart button
 
Quote:

Originally Posted by xcartukguy
I suggest the input though so you've got a fallback for non-javascript useability.

Forget user's without JavaScript. Javascript is required for todays web to function. Just my opinion.

xcartukguy 09-27-2012 12:49 AM

Re: ajax add to cart button
 
Quote:

Originally Posted by Brett Forsyth
Was there JS files you were missing though? I have been through everything and can't seem to find anything missing. The code is the same as the default theme but I can't get it to stop reloading the page.


I just used the default template... and removed things.

Quote:

Originally Posted by totaltec
Forget user's without JavaScript. Javascript is required for todays web to function. Just my opinion.



But using an input means you still have functionality without javascript and looks the same.


All times are GMT -8. The time now is 02:12 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.