I'm using Magento 1.9 and can't figure out why the state field in the billing and shipping forms used in the onepage checkout process don't show up. Here's the code for the billing form:
frontend/default/mycompany/template/persistent/checkout/onepage/billing.phtml:
<div class="input-box">
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
<option value=""><?php echo $this->__('State/Province') ?></option>
</select>
<script type="text/javascript">
//<![CDATA[
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
//]]>
</script>
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" placeholder="<?php echo $this->__('State/Province') ?>" style="display:none;" /></div>
Even if I remove the inline styling in the tag, style="display:none;", the field still doesn't show up.
Where is the javascript file that is controlling the show/hide function of this field? The JS script is setting an attribute to a default value; however, the php code, getAddress()->getRegionId() ?>, yields a blank.
Is there a setting in the Admin panel that controls whether or not this field is displayed? The default country is set for the US.