Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    UK
    Posts
    478
    Plugin Contributions
    0

    Default A "space" appears in Customer record when inserting the State/County in "other" box

    I will try to explain this

    Create an account - Login page

    In 1.5.4.

    I have these settings (in customer details):

    State true
    State - Always display as pulldown? true

    Set up - now if the zone files DO NOT contain a STATE for the Country that they pick the form displays an "OTHER" box to be filled in with the State "Type a choice below" it says

    This is the HTML created

    Code:
    <input type="text" name="state" value="&nbsp;" size = "33" maxlength = "32" id="state" />
    As you can see that &nbsp; is the issue! So if you fill in that extra field when it get inserted into the database an extra space at the start of the State appears

    Whilst not a big issue it is when tying with a sage accounting package as it cannot recognise the State as it starts with a space!

    So trying to find where this extra space is coming from (not sure if my set up or a bug)

    In looking at includes/templates/my template/templates/tpl_modules_create_account.php but I cannot see where the "other" box appears - it seems to be looking at the code in the JS files as I can see this

    Code:
      } else {
        theForm.zone_id.options[0] = new Option("Type a choice below ...", "");
        showStateField(theForm);
      }
    but I still cannot see where its actually creating the form field

    Any ideas of where else I can look ?? Its tough hunting for a space but its throwing out the sage system so NOT finding it is not an option at present

    I have looked in the modules/pages/create_account files and not spotting any spaces!

    Can some one tell me where that "other" form field is actually created - as I can see the extra space on the website before I type something in! Just not where the HTML code is to create it!

    Thank you
    Sarah

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: A "space" appears in Customer record when inserting the State/County in "other" b

    Lot's of bouncing balls to follow... The Text of the 'Type a Choice Below ...' is presented through the includes/functions/functions_general.php file by the constant TYPE_BELOW in the functions zen_prepare_country_zones_pull_down and zen_js_zone_list.

    The specific javascript you see is created in the later function.

    The showstatefield javascript function is found in includes/modules/pages/create_account/jscript_addr_pulldowns.php and simply presents what the data is that is fed to it.

    The fact that the space exists upon initial display indicates that dealing with a "preparation" cycle and not necessarily a "verification" cycle, although the space(s) could be trimmed upon submission if the source can not be found...

    Unfortunately I need to stop at this point, but perhaps this offers a little assistance...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2004
    Location
    UK
    Posts
    478
    Plugin Contributions
    0

    Default Re: A "space" appears in Customer record when inserting the State/County in "other" b

    Thank you - and yes I too found all of those details but I need to find where it actually creates the HTML Form field as I believe that is where that pesky space appears - and I am really not sure of where that function or code part is! Any help with that appreciated :)

 

 

Similar Threads

  1. Can change "state" to town or county?
    By fullthrottleprojects in forum Managing Customers and Orders
    Replies: 5
    Last Post: 16 Sep 2012, 09:40 PM
  2. Replies: 16
    Last Post: 21 Apr 2010, 07:38 PM
  3. Replies: 2
    Last Post: 11 Feb 2010, 09:13 PM
  4. How do I change "state" to "county"?
    By James B1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 May 2008, 07:01 PM
  5. Inside the "Categories" box it says "New Products" and "All Products"...
    By john9 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Feb 2007, 07:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR