...

View Full Version : Form Problem



dragonusthei
10-21-2006, 06:07 PM
Hello,

Im having a problem with my javascript form in my checkout.

Its not passing the values from post code to post code and country to country to see what i mean please visit

http://dogtoybeta.co.uk/public/cart/?add=1

and press checkout

then press the same as billing button


I dont know what the proble is it was working :s

dragonusthei
10-22-2006, 08:13 PM
any one?

Beagle
10-23-2006, 02:44 AM
It's most likely a javascript error. Care to post your code, or is it too large?

dragonusthei
10-23-2006, 05:56 PM
only about 10 lines of code if you go the site and press checkout then view the source code right at the bottom thats the javascript i cannot post the code becuase it depends what options are selected in the cart to what javascripts dispayed.

radnor
10-23-2006, 06:42 PM
I pulled your page off line and changed the JS a little. (MAINLY cleaned it up and REMOVED the reference to COUNTRY - since it is NOT on your form)


<script language="JavaScript">
<!-- Begin

var address1 = "";
var address2 = "";
var city = "";
var county = "";
var state = "";
var post_code = "";

function InitSaveVariables(form) {
address1 = form.address1.value;
address2 = form.address2.value;
city = form.city.value;

if(form.county){
county = form.county.value;
}
if(form.state){
state = form.state.value;
}
post_code = form.post_code.value;
}

function ShipToBillPerson(form) {
if (form.copy.checked) {
InitSaveVariables(form);
form.address1.value = form.b_address1.value;
form.address2.value = form.b_address2.value;
form.city.value = form.b_city.value;
if(form.county){
form.county.value = form.b_county.value;
}
if(form.state){
form.state.value = form.b_state.value;
}
form.post_code.value = form.b_post_code.value;
} else {
form.address1.value = address1;
form.address2.value = address2;
form.city.value = city;
if(form.county){
form.county.value = county;
}
if(form.state){
form.state.value = state;
}
form.post_code.value = post_code;
}
}
// End -->

</script>

radnor
10-23-2006, 06:45 PM
By removing the ref to COUNTRY (not in your form), I have it working in FF and IE.

dragonusthei
10-24-2006, 12:01 AM
but some times country does exist when they select a diffrent option in the cart :s

radnor
10-24-2006, 12:13 AM
Well, based on the link YOU provided, country was not there.... So, if you do NOT need country, maybe a HIDDEN field and let it do it's thing on it...

Don't know....

Maybe a TEST on the form. If country field, do this.... If not, skip it...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum