add new field in magento(1.9) customer registration without changing core files
-
29-09-2020 - |
Question
I am new in Magento development and customization I am trying to add a mobile field in new customers registration form I have followed this article but I am stuck https://stackoverflow.com/questions/11501020/magento-add-a-field-on-default-registration-form
So, Please guide me through the perfect way without changing core files.
Solution
<li>
<label for="mobile" class="required"><em>*</em><?php echo $this->__('Mobile') ?></label>
<div class="input-box">
<input type="text" name="mobile" id="mobile" value="<?php echo $this->htmlEscape($this->getFormData()->getMobile()) ?>" title="<?php echo $this->__('Mobile') ?>" class="input-text required-entry validate-phoneStrict validate-email" />
</div>
</li>
replace to
<li>
<label for="mobile" class="required"><em>*</em><?php echo $this->__('Mobile') ?></label>
<div class="input-box">
<input type="text" name="mobile" id="mobile" value="<?php echo $this->htmlEscape($this->getFormData()->getMobile()) ?>" title="<?php echo $this->__('Mobile') ?>" class="input-text required-entry validate-phoneStrict" />
</div>
</li>
You don't need validate-email if you need phone number validation
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange