Announcement

Collapse
No announcement yet.

Post Code in Capitals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Post Code in Capitals

    Hi,

    I've gone through the AUG and implemented the Capitalization of some fields. But was confused as to why the Post Code wasnt appearing to work. I then re-read carefully and now understand that Captization isnt the same as putting it into uppercase. Fine I understand that now.

    So I searched the forum and found a thread that explain how to to do this.

    http://community.actinic.com/showthread.php?t=19468

    However I'm not sure it wasnt written before V8. It talks about going into actinicextras.js and using the command

    onblur="format(this,'X')"

    Now I think this would still work but since I've used the "newer" method of using the "design" tab to make changes I'd like to continue that a) it's easier b) it more obvious when reviewing the code to see what changes / extra I've added.

    So my question is :- is it possible to make the same changes by using the Design Tab in V8? ie. Change the Post Code to all Upper Case (incl the space) and turning the email address into lower case

    Sure its the same code but before I try would like some reassurance / guidence

    Cheers

    Matt
    Matthew Wildeman
    www.bigmatts.com
    2XL to 8XL Menswear

    #2
    Hi,

    You can put the javascript function in directly before the </head> tag in the overall layout used by your checkout rather than the js file, just surround it with

    <script language="javascript" type="text/javascript">
    <!--

    and

    // -->
    </script>

    so it will look like:

    Code:
     <script language="javascript" type="text/javascript">
          <!-- 
    function format(el,f){
    if (!el.value){
    	return false;
    	}
    if (f=="upper"){
    	el.value=el.value.toUpperCase();
    	}
    else if (f=="lower"){
    	el.value=el.value.toLowerCase();
    	}
    else if (f=="capitals"){
    	el.value=el.value.toLowerCase();
    	var re=/(^.|\s.)/gi;
    	var arr=el.value.match(re);
    	for (i=0;i<arr.length;i++){
    		el.value=el.value.replace(arr[i],arr[i].toUpperCase());
    		}
    	var re=/(Mc(.)|Mac(.)|O'(.))/g;
    	var arr=el.value.match(re);
    	if (arr){
    		for (i=0;i<arr.length;i++){
    			el.value=el.value.replace(arr[i],arr[i].substring(0,arr[i].length-1)+(arr[i].substring(arr[i].length-1,arr[i].length)).toUpperCase());
    			}
    		}
    	}
    }
    		// -->
    		</script>
    That way you can do it all in the v8 design tab.
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      thanks

      Thanks

      knew it would be as simple as that just wanted to check

      thanks

      mat
      Matthew Wildeman
      www.bigmatts.com
      2XL to 8XL Menswear

      Comment


        #4
        Not working everytime

        Hi,

        I followed the above instructions sometime ago. And it works but only about 90% of the time. Every now and then I get an order through with the post code still in lower case? Any ideas?
        I thought maybe if the customer was entering the post code in CAPS already is changes it to lower case. But looking at the code this case seems to be covered (as you would expect). So not sure whats happening.
        This isnt a major issue but it is annoying and help welcome.

        Matthew
        Matthew Wildeman
        www.bigmatts.com
        2XL to 8XL Menswear

        Comment


          #5
          could they be repeat customers?
          If a customers returns and they have their details stored on their computer already, it doesn't capitalised etc it just churns it out as they typed it previously.

          I still get these...it's annoying..but not half as annoying as having to format nearly every address!
          Tracey

          Comment


            #6
            It uses javascript so won't work unless javascript is enabled.

            Having said that, a quick look at my stats tells me that of my last 133 visitors, only 1 didn't have javascript enabled.

            I certainly see less than 10% in lower case. For me it's more like 1 order in 100.

            Mike
            -----------------------------------------

            First Tackle - Fly Fishing and Game Angling

            -----------------------------------------

            Comment


              #7
              Repeat

              Thanks guys,

              I think its the repeat customer issue. I didn't know it just used the previuos data from customers it already knows. That would explain the 10% ratio of problems, though 1% might be the java not being enabled.

              Thanks I now understand whats happening

              Mat
              Matthew Wildeman
              www.bigmatts.com
              2XL to 8XL Menswear

              Comment

              Working...
              X