My field Zip still stay unrequired in my customer form
-
12-12-2019 - |
Question
I try to put a required-entry to my field "zip" but the <label>
<em>*</em>
still shows as display:none
.
If someone can help me it would be great =)
<li class="fields">
<div class="field">
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
<div class="input-box">
<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 required-entry validate-zip <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
</div>
</div>
<div class="field">
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
<div class="input-box">
<?php echo $this->getCountryHtmlSelect() ?>
</div>
</div>
</li>
As you can see they are: <em style="display:none;">*</em>
and <input [...] class="input-text validate-zip">
even if i set required-entry
in my code, the class required-entry
is not apply
Solution
Instead of required class use required-entry
Let me know if it is solved.
OTHER TIPS
From admin panel ->catalog->attributes->manage attributes you can edit your zip field properties and set 'Values Required' to 'YES'
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange