Pin-code on Checkout Page 6 digit fix

Replace bello code in checkout page of magento 

<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('opc')->getAttributeValidationClass('postcode') ?>" maxlength="6" onblur="postcode_validate(this.value);" />

Add Bellow function end of the page code

//Added for putting the zipcode validation of digit only

function postcode_validate(zipcode)


var regPostcode = /^([1-9])([0-9]){5}$/;


obj = document.getElementById("billing:postcode");//status


if(regPostcode.test(zipcode) == false)


//obj.innerHTML = "Postcode is not yet valid. Please put valid Zipcode";

alert("ZipCode should be of 6 digit");







Contact Us