Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    29
    Plugin Contributions
    0

    Default UK Postcode Lookup

    Has anyone got this add-on to work? The postcode lookup works fine, but having problems with getting the confirm terms and conditions side of it to work. After submitting the form, the error message comes up that the box hasn't been ticked, but yet when I do tick it, it does not keep it selected. Any ideas. Here is the code of tpl_modules_create_account.php. Have a couple of other modules that must be interfering:

    Code:
    <?php
    
    /**
    
     * Page Template
    
     *
    
     * Loaded automatically by index.php?main_page=create_account.<br />
    
     * Displays Create Account form.
    
     *
    
     * @package templateSystem
    
     * @copyright Copyright 2007 Numinix Technology http://www.numinix.com
     * @copyright Copyright 2003-2006 Zen Cart Development Team
    
     * @copyright Portions Copyright 2003 osCommerce
    
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    
     * @version $Id: tpl_modules_create_account.php 4823 2007-09-29 15:23:59Z numinix $
     */
    ?>
    <?php if ($messageStack->size('create_account') > 0) echo $messageStack->output('create_account'); ?>
    
    <script type="text/javascript">
    
    function capitalize(f,m) {
    
    if (m) /*cap words*/ {
    	var temp, tempC, pre, post, strlen;
    	temp = f.value.toLowerCase();
    	stringLen = temp.length;
    	  if (stringLen > 0) {
    		for (i = 0; i < stringLen; i++) {
    		  if (i == 0) {
    			tempC = temp.substring(0,1).toUpperCase();
    			post = temp.substring(1,stringLen);
    			temp = tempC + post;
    		  } else {
    			tempC = temp.substring(i,i+1);
    			if (tempC == " " && i < (stringLen-1)) {
    			tempC = temp.substring(i+1,i+2).toUpperCase();
    			pre = temp.substring(0,i+1);
    			post = temp.substring(i+2,stringLen);
    			temp = pre + tempC + post;
    		  }
    		}
    	  }
    	}
      } else /*cap all*/ {
        var temp = f.value.toUpperCase();
      }
      f.value = temp;
    };
    
    </script>
    
    
    
    <div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
    
    <br class="clearBoth" />
    
    
    
    <?php
    
      if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
    
    ?>
    
    <fieldset>
    
    <legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
    
    <div class="information"><?php echo TEXT_CONDITIONS_DESCRIPTION; ?></div>
    
    <?php echo  zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
    
    <label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
    
    </fieldset>
    
    <?php
    
      }
    
    ?>
    
    
    
    <?php
    
      if (ACCOUNT_COMPANY == 'true') {
    
    ?>
    
    <fieldset>
    
    <legend><?php echo CATEGORY_COMPANY; ?></legend>
    <br class="clearBoth"/>
    <label class="inputLabel" for="company"><?php echo ENTRY_COMPANY; ?></label>
    
    <?php echo zen_draw_input_field('company', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' id="company"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?>
    
    </fieldset>
    
    <?php
    
      }
    
    ?>
    
    
    
    <fieldset>
    
    <legend><?php echo TABLE_HEADING_ADDRESS_DETAILS; ?></legend>
    <br class="clearBoth"/>
    <?php
    
      if (ACCOUNT_GENDER == 'true') {
    
    ?>
    
    <?php echo zen_draw_radio_field('gender', 'm', '', 'id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' . MALE . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE . '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' . ENTRY_GENDER_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    ?>
    
    
    
    <label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>
    
    <?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME; ?></label>
    
    <?php echo zen_draw_input_field('lastname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', '40') . ' id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <label class="inputLabel" for="street-address"><?php echo ENTRY_STREET_ADDRESS; ?></label>
    
      <?php echo zen_draw_input_field('street_address', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' id="street-address"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <?php
    
      if (ACCOUNT_SUBURB == 'true') {
    
    ?>
    
    <label class="inputLabel" for="suburb"><?php echo ENTRY_SUBURB; ?></label>
    
    <?php echo zen_draw_input_field('suburb', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', '40') . ' id="suburb"') . (zen_not_null(ENTRY_SUBURB_TEXT) ? '<span class="alert">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    ?>
    
    
    
    <label class="inputLabel" for="city"><?php echo ENTRY_CITY; ?></label>
    
    <?php echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <?php
    
      if (ACCOUNT_STATE == 'true') {
    
        if ($flag_show_pulldown_states == true) {
    
    ?>
    
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
    
    <?php
    
          echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"');
    
          if (zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert">' . ENTRY_STATE_TEXT . '</span>'; 
    
        }
    
    ?>
    
    
    
    <?php if ($flag_show_pulldown_states == true) { ?>
    
    <br class="clearBoth" id="stBreak" />
    
    <?php } ?>
    
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
    
    <?php
    
        echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"');
    
        if (zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert" id="stText">' . ENTRY_STATE_TEXT . '</span>';
    
        if ($flag_show_pulldown_states == false) {
    
          echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
    
        }
    
    ?>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    ?>
    
    
    
    <label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE; ?></label>
    
    <?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    
    <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    </fieldset>
    
    
    <!--Remove Additional Contact Details M Fairhurst 22 January 2009
    <fieldset>
    
    <legend><?php echo // TABLE_HEADING_PHONE_FAX_DETAILS; ?></legend>
    
    <br class="clearBoth"/>
    <label class="inputLabel" for="telephone"><?php echo // ENTRY_TELEPHONE_NUMBER; ?></label>
    
    
    <?php echo //zen_draw_input_field('telephone', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', '40') . ' id="telephone"') . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?>
    
    
    
    <?php
    
    //  if (ACCOUNT_FAX_NUMBER == 'true') {
    
    ?>
    
    <br class="clearBoth" />
    
    <label class="inputLabel" for="fax"><?php echo //ENTRY_FAX_NUMBER; ?></label>
    
    <?php echo //zen_draw_input_field('fax', '', 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?>
    
    <?php
    
    //  }
    
    ?>
    
    </fieldset>
    EO Remove Additional Contact Details M Fairhurst 22 January 2009 -->
    
    
    <?php
    
      if (ACCOUNT_DOB == 'true') {
    
    ?>
    
    <fieldset>
    
    <legend><?php echo TABLE_HEADING_DATE_OF_BIRTH; ?></legend>
    <br class="clearBoth"/>
    <label class="inputLabel" for="dob"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
    
    <?php echo zen_draw_input_field('dob','', 'id="dob"') . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="alert">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    </fieldset>
    
    <?php
    
      }
    
    ?>
    
    
    
    <fieldset>
    
    <legend><?php echo TABLE_HEADING_LOGIN_DETAILS; ?></legend>
    <br class="clearBoth"/>
    <label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
    
    <?php echo zen_draw_input_field('email_address', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="email-address"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <?php
    
      if ($phpBB->phpBB['installed'] == true) {
    
    ?>
    
    <label class="inputLabel" for="nickname"><?php echo ENTRY_NICK; ?></label>
    
    <?php echo zen_draw_input_field('nick','','id="nickname"') . (zen_not_null(ENTRY_NICK_TEXT) ? '<span class="alert">' . ENTRY_NICK_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    ?>
    
    
    
    <label class="inputLabel" for="password-new"><?php echo ENTRY_PASSWORD; ?></label>
    
    <?php echo zen_draw_password_field('password', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-new"') . (zen_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    
    
    <label class="inputLabel" for="password-confirm"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></label>
    
    <?php echo zen_draw_password_field('confirmation', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-confirm"') . (zen_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    </fieldset>
    
    
    
    <fieldset>
    
    <legend><?php echo ENTRY_EMAIL_PREFERENCE; ?></legend>
    <br class="clearBoth"/>
    <?php
    
      if (ACCOUNT_NEWSLETTER_STATUS != 0) {
    
    ?>
    
    <?php echo zen_draw_checkbox_field('newsletter', '1', $newsletter, 'id="newsletter-checkbox"') . '<label class="checkboxLabel" for="newsletter-checkbox">' . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?>
    
    <br class="clearBoth" />
    
    <?php } ?>
    
    
    
    <?php echo zen_draw_radio_field('email_format', 'HTML', ($email_format == 'HTML' ? true : false),'id="email-format-html"') . '<label class="radioButtonLabel" for="email-format-html">' . ENTRY_EMAIL_HTML_DISPLAY . '</label>' .  zen_draw_radio_field('email_format', 'TEXT', ($email_format == 'TEXT' ? true : false), 'id="email-format-text"') . '<label class="radioButtonLabel" for="email-format-text">' . ENTRY_EMAIL_TEXT_DISPLAY . '</label>'; ?>
    
    <br class="clearBoth" />
    
    </fieldset>
    
    
    
    <?php
    
      if (CUSTOMERS_REFERRAL_STATUS == 2) {
    
    ?>
    
    <fieldset>
    
    
    
    <legend><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></legend>
    <br class="clearBoth"/>
    <label class="inputLabel" for="customers_referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>
    
    <?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '15') . ' id="customers_referral"'); ?>
    
    <br class="clearBoth" />
    
    </fieldset>
    
    <?php } ?>
    <?php
    // BOF Captcha
    if (CAPTCHA_CREATE_ACCOUNT != 'false') {
    	if(is_object($captcha)) {
    ?>
    		<fieldset>
    		<legend><?php echo TITLE_CAPTCHA; ?></legend>	
    		<br class="clearBoth" />
    		<?php echo $captcha->img(); ?>
    		<?php echo $captcha->redraw_button(BUTTON_IMAGE_CAPTCHA_REDRAW, BUTTON_IMAGE_CAPTCHA_REDRAW_ALT); ?>
    		<br class="clearBoth" />
    		<br class="clearBoth" />
    		<label for="captcha"><?php echo TITLE_CAPTCHA; ?></label>
    		<?php echo $captcha->input_field('captcha', 'id="captcha"') . '&nbsp;<span class="alert">' . TEXT_CAPTCHA . '</span>'; ?>
    		<br class="clearBoth" />
    		</fieldset>
    		<?php
    	}
    }
    // EOF Captcha
    ?>

  2. #2
    Join Date
    Apr 2008
    Posts
    29
    Plugin Contributions
    0

    Default Re: UK Postcode Lookup

    Got it working now.

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: UK Postcode Lookup

    Quote Originally Posted by MaryF View Post
    Got it working now.
    How did you get it working?? Why not post and so help
    other forum users

  4. #4
    Join Date
    Apr 2008
    Posts
    29
    Plugin Contributions
    0

    Default Re: UK Postcode Lookup

    Yes, I was going to but got interrupted with running my business and never got back to it!
    I removed the tick the box to confirm conditions on the account create page (as this is done again on the next page anyway). At first I didn't know where to remove this, but found the answer on google > then went to link inside wiki.
    I also changed the http ref inside the code ( https://services.postcodeanywhere.co...pups/......etc. ) to https as the page was throwing up errors in IE (not in Firefox though). So now hopefully it will work OK. If someone could check the account create page and give me some comments, that would be great. Thanks.

    I would not be able to do half the stuff I do without finding the answers on the internet.

    misty you are correct in that we should make an effort to record what we did to find the answer as it helps other people with the same problem.
    Last edited by MaryF; 7 Feb 2009 at 12:41 PM. Reason: url link should not be a link, just a reference

  5. #5
    Join Date
    Apr 2008
    Posts
    29
    Plugin Contributions
    0

    Default Re: UK Postcode Lookup

    Sorry, that should not be a url link - the account create page is on my website see my signature.

 

 

Similar Threads

  1. Database lookup, cross reference lookup, exist?
    By chowardart in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Aug 2014, 07:05 PM
  2. UK Postcode Lookup
    By flobster in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 19 Aug 2011, 12:06 AM
  3. UK Postcode Lookup Address Completion
    By Reesy in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 4 Jan 2011, 11:49 AM
  4. UK Postcode Lookup
    By Fuzion in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 23 Jan 2008, 01:46 PM

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