1
votes

In my app(Magento v1.7), I don’t want user to input their password when registration. So I comment out the following code on page app\design\frontend\base\default\template\persistent\customer\form\register.phtml

<ul class="form-list">
     <li class="fields">
         <div class="field">
              <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
              <div class="input-box">
                   <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
              </div>
          </div>
          <div class="field">
               <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
               <div class="input-box">
                     <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
               </div>
           </div>
      </li>
      <?php echo $this->getChildHtml('persistent.remember.me'); ?>
</ul>

But the warning message ‘The password cannot be empty.’ is still displayed when registration. How to remove this warning msg?

Many thanks

2

2 Answers

1
votes

The password is validated at Mage_Customer_Model_Customer::validate() so you either override this function or make a hidden field name="password" and input some dummy info there you can later override with your generated passwords whatsoever. However this might be a security hole if you don't overwrite the password right away.

-2
votes

Remove the class "required-entry" from the password field.