Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Form Problem

  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Problem

    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

  • #2
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    any one?

  • #3
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    It's most likely a javascript error. Care to post your code, or is it too large?

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)

    Code:
    <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>

  • #6
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By removing the ref to COUNTRY (not in your form), I have it working in FF and IE.

  • #7
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but some times country does exist when they select a diffrent option in the cart :s

  • #8
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •