I seem to have a conflict between the code that allows for multiple products to be added to a cart all at once and the code needed to validate whether a dropdown/select choice has been made. When (the two code snippets I'll paste below) appear on the same page, select dropdowns don't validate - and buttons no longer add multiple products to the cart.
Conflicting code snippet #1:
<script language="javascript" type="text/javascript">
<!--
function EJEJC_lc(th) { return false; }
// -->
</script>
---------------------------versus----------------------
Conflicting code snippet #2:
<script src="http://www.e-junkie.com/ecom/box.js" type="text/javascript"></script>
I've managed to "work around" this by putting each snippet of code only on pages where currently needed (pages where I don't need both sorts of coding) - but this tells me that I may eventually have trouble when a product with a select dropdown needs to appear on the same page that has a button used to add more than one product.
Here is the code I use to add a product that requires a selection:
<form name='ejChoicesSelect' action='https://www.e-junkie.com/ecom/gb.php?c=cart&i=27
&cl=11392&ejc=2' target='ej_ejc' method='POST' accept-charset='UTF-8' onSubmit='return validate_ej_form_dd ( );'>
<input type='hidden' name='on0' value='Color'/>
<select name='os0'>
<option selected>Choose Color
<option value='black'>black<option value='gold'>gold
</select>
<input type='image' src='https://www.e-junkie.com/ej/ejadd_to_cart.gif' border='0' alt='Add to Cart' class='ec_ejc_thkbx'/>
</form>
<a href='https://www.e-junkie.com/ecom/gb.php?c=cart&cl=11392&ejc=2' target='ejejc' class='ec_ejc_thkbx'><img src='https://www.e-junkie.com/ej/ejview_cart.gif' border='0' alt='View Cart'/></a>
[I haven't pasted in the javascript "validate_ej_form_dd" called above as it seems to not be causing the issue.]
=====================
Here's the code I use to add multiple products:
<a href="javascript:EJEJC_multiAdd(Array(
'https://www.e-junkie.com/ecom/gb.php?c=cart&i=5&cl=11392&ejc=2',
'https://www.e-junkie.com/ecom/gb.php?c=cart&i=28&cl=11392&ejc=2'
));"><img src='..files/icons/AddBothToKart.gif' border='0' alt='Add to Cart'/></a>
<a href='https://www.e-junkie.com/ecom/gb.php?c=cart&cl=11392&ejc=2' target='ejejc' class='ec_ejc_thkbx'><img src='https://www.e-junkie.com/ej/ejview_cart.gif' border='0' alt='View Cart'/></a>
=====================
And, here is the code I use (can also appear alongside code above) that adds a single product to the cart:
<a href='https://www.e-junkie.com/ecom/gb.php?c=cart&i=5&cl=11392&ejc=2' target='ejejc' class='ec_ejc_thkbx'><img src='https://www.e-junkie.com/ej/ejadd_to_cart.gif' border='0' alt='Add to Cart'/></a>
Any thoughts on what might be causing the conflict?
created
Nov '11
last reply
Nov '11
- 1
reply
- 972
views
- 2
users
- 9
links