I have a select box like this

<div class="input-box">
    <select name="billing[country_id]" id="billing-country_id" class="validate-select" title="Land">
        <option value=""> </option>
        <option value="AX">Alandinseln</option>
        <option value="BB">Barbados</option>
        <option value="DE" selected="selected">Deutschland</option>

I want validation for only "Deutschland". I tryed like this in input Zip/code but it check all land.

<input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" /> 

My js:

<script type="text/javascript">
        ['validate-zip-international-by-comvn', 'Oh, die Postleitzahl sieht seltsam aus. Schau doch bitte noch einmal.', function(v) {
            return Validation.get('IsEmpty').test(v) || /(^[0-9]{5}$)/.test(v);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.