[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/modules/pages/checkout_payment_address/ -> jscript_addr_pulldowns.php (source)

   1  <?php
   2  /**

   3   * jscript_addr_pulldowns

   4   *

   5   * handles pulldown menu dependencies for state/country selection

   6   *

   7   * @package page

   8   * @copyright Copyright 2003-2006 Zen Cart Development Team

   9   * @copyright Portions Copyright 2003 osCommerce

  10   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

  11   * @version $Id: jscript_addr_pulldowns.php 4830 2006-10-24 21:58:27Z drbyte $

  12   */
  13  ?>
  14  <script language="javascript" type="text/javascript"><!--
  15  
  16  function update_zone(theForm) {
  17    // if there is no zone_id field to update, or if it is hidden from display, then exit performing no updates

  18    if (!theForm || !theForm.elements["zone_id"]) return;
  19    if (theForm.zone_id.type == "hidden") return;
  20  
  21    // set initial values

  22    var SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;
  23    var SelectedZone = theForm.elements["zone_id"].value;
  24  
  25    // reset the array of pulldown options so it can be repopulated

  26    var NumState = theForm.zone_id.options.length;
  27    while(NumState > 0) {
  28      NumState = NumState - 1;
  29      theForm.zone_id.options[NumState] = null;
  30    }
  31    // build dynamic list of countries/zones for pulldown

  32  <?php echo zen_js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>
  33  
  34    // if we had a value before reset, set it again

  35    if (SelectedZone != "") theForm.elements["zone_id"].value = SelectedZone;
  36  
  37  }
  38  
  39    function hideStateField(theForm) {
  40      theForm.state.disabled = true;
  41      theForm.state.className = 'hiddenField';
  42      theForm.state.setAttribute('className', 'hiddenField');
  43      document.getElementById("stateLabel").className = 'hiddenField';
  44      document.getElementById("stateLabel").setAttribute('className', 'hiddenField');
  45      document.getElementById("stText").className = 'hiddenField';
  46      document.getElementById("stText").setAttribute('className', 'hiddenField');
  47      document.getElementById("stBreak").className = 'hiddenField';
  48      document.getElementById("stBreak").setAttribute('className', 'hiddenField');
  49    }
  50  
  51    function showStateField(theForm) {
  52      theForm.state.disabled = false;
  53      theForm.state.className = 'inputLabel visibleField';
  54      theForm.state.setAttribute('className', 'visibleField');
  55      document.getElementById("stateLabel").className = 'inputLabel visibleField';
  56      document.getElementById("stateLabel").setAttribute('className', 'inputLabel visibleField');
  57      document.getElementById("stText").className = 'alert visibleField';
  58      document.getElementById("stText").setAttribute('className', 'alert visibleField');
  59      document.getElementById("stBreak").className = 'clearBoth visibleField';
  60      document.getElementById("stBreak").setAttribute('className', 'clearBoth visibleField');
  61    }
  62  //--></script>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics