E-Junkie Forum http://www.e-junkie.com/bb/ E-Junkie Forum RSS en-us Copyright 2013, 19.5 Degrees. All rights reserved. webmaster@e-junkie.com webmaster@e-junkie.com Tue, 17 Jan 2012 20:33:21 GMT Sat, 25 May 2013 11:28:12 GMT 681 E-JUNKIE 5 E-Junkie Forum http://www.e-junkie.com/bb/ http://www.e-junkie.com/ej/logo.gif 290 104 Post #8 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Tue, 17 Jan 2012 20:33:21 GMT http://www.e-junkie.com/ej/developer-directory.htm]]> E-junkie Discussions; E-junkieGuru Post #7 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Tue, 17 Jan 2012 02:12:32 GMT
I have been trying to implement validation of my two variation text fields, to make sure they both have entries when the form is submitted to e-junkie. The button code e-junkie gives me is:

<form action="https://www.e-junkie.com/ecom/gb.php?c=cart&i=G2G-DW-1YR&cl=101445&ejc=2" target="ej_ejc" method="POST" accept-charset="UTF-8">
<input type="hidden" name="on0" value="Desktop User Name"/>
Desktop User Name:<br/>
<input type="text" name="os0" maxlength="200"/>
<br/>
<input type="hidden" name="on1" value="Registration Email"/>
Registration Email:<br/>
<input type="text" name="os1" maxlength="200"/>
<br/>
<input type="image" src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this.parentNode);"/>
</form>

I then add

form name="myForm" onSubmit="return validateForm()"

in the form code.

I also add validateForm() script which returns False if either text field is blank or null:

function validateForm()
{
var x=document.forms["myForm"]["os0"].value;
if (x==null || x=="")
{
alert("Desktop Name can't be blank!");
return false;
}
var x=document.forms["myForm"]["os2"].value;
if (x==null || x=="")
{
alert("Registration Email can't be blank!");
return false;
}
}

I would expect the onSubmit code to terminate the submit if either text field is blank. However, it seems like the e-junkie submit listener doesn't respond, and instead, the shopping cart displays (with blank text fields).

Can you tell me what I'm doing wrong here? Should the validation code be able to terminate the e-junkie server before the cart displays?]]>
E-junkie Discussions; vizioneer
Post #6 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Tue, 17 Jan 2012 01:13:24 GMT E-junkie Discussions; E-junkieGuru Post #5 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Mon, 16 Jan 2012 14:14:49 GMT E-junkie Discussions; vizioneer Post #4 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Mon, 16 Jan 2012 03:13:45 GMT http://www.e-junkie.com/ej/help.variants.htm

That said, the specific issue you're seeing is that your custom script is adding the item to a cart without invoking our View Cart box.js script, so the cart is displaying in a full window under the e-junkie.com domain in that case. When the View Cart code including our box.js script is present in the page source, our standard Add to Cart and View Cart button codes display the cart as an overlay "inside" your page, under your own domain. These two versions of the cart display necessarily get treated as separate carts because we set a cookie in the buyer's browser to keep track of their cart contents, and cookies must be set as associated with a specific domain.]]>
E-junkie Discussions; E-junkieGuru
Post #3 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Sun, 15 Jan 2012 01:51:55 GMT
http://www.mindsparkinc.com/buttons_test.html

Thanks for taking a look.]]>
E-junkie Discussions; vizioneer
Post #2 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Sat, 14 Jan 2012 18:22:52 GMT E-junkie Discussions; E-junkieNinja Post #1 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 http://www.e-junkie.com/bb/topic/5673/pg/0#post20085 Sat, 14 Jan 2012 03:56:22 GMT
However, I haven't been able to get "View Cart" to work with your standard code. I've put it (and its code) on the same page as the "add to order" buttons, but the cart always comes up empty even if I put items in it. I think this is because the view cart button and code aren't in the same window as the add to cart code. Am I right? If so, is there any way I can still display the cart contents?]]>
E-junkie Discussions; vizioneer