ok, I've think I've found the solution. Can anyone tell me if I'm missing something before I put it into production, please?
skip post code check for given country code
includes/modules/pages/login/jscript_form_check.php
Code:
//103 is code for Ireland, therefore skip postcode check for ireland. Codes can be seen
//by viewing source of page with country drop down list.
if (document.getElementById('country').value != 103) {
check_input("postcode", 4, "Your Post/ZIP Code must contain a minimum of 4 characters.");
}
hide post code if given country is selected
includes/modules/pages/login/jscript_addr_pulldowns.php
Code:
//placed at top of function update_zone
if (document.getElementById('country').value == 103){
document.getElementById('hide_postcode').style.visibility='hidden';
} else {
document.getElementById('hide_postcode').style.visibility='visible';
}
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
make update happen if country list is changed
Code:
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('zone_country_id', $selected_country,
'id="country" '. 'onchange="update_zone(this.form);"') .
(zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' .
ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
</fieldset>
add div to contain elements that will be hidden
Code:
<div id="hide_postcode">
<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" />
</div>
This works. The top two edits should be added to includes/modules/pages/create_account/jscript_form_check.php and includes/modules/pages/create_account/jscript_addr_pulldowns.php The files in login and create_account have the same data.
Hope this helps someone with the same problem and is a valid solution to the problem. If any zen pros see issues please let me know ASAP.
Bookmarks