How to remove ‘password cannot be empty’ msg on the registration form

How to remove ‘password cannot be empty’ msg on the registration form

August 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to remove ‘password cannot be empty’ msg on the registration form

Removing the ‘Password Cannot Be Empty’ Warning Message on Magento Registration Form

When configuring your Magento store (version 1.7 and later), you might want to allow users to register without inputting their password manually. This can streamline the user experience, especially for scenarios where passwords are automatically generated or managed via third-party integrations.

The Initial Approach: Commenting Out Form Fields

You may start by commenting out the relevant form fields in your theme’s registration template located at app/design/frontend/base/default/template/persistent/customer/form/register.phtml. Here is how you would comment out these lines:

<!--
<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>
-->

While this approach removes the form fields from the HTML, it doesn’t actually prevent the error message from appearing.

The Underlying Issue: Validation Script

The issue lies in the validation script located at js/validation.js. This script checks for empty password fields and throws an error even if you have removed them from the UI. To resolve this:

  1. Open the file app/design/frontend/base/default/js/validation.js.
  2. Locate the function validatePassword() around line 69.
  3. Comment out or delete these lines:
if (val == '') {
    error = true;
}
  1. Save your changes and clear Magento’s cache.

The Result: Error Message is Removed

After making this change, when a user tries to register without entering a password, the “The password cannot be empty.” warning will no longer appear. The form will simply proceed with other fields intact, allowing users to complete their registration process seamlessly.

Remember, this approach requires careful consideration of your store’s security and customer experience. If you’re not generating secure passwords via another mechanism (like a third-party service or plugin), it might be safer to require manual password entry for enhanced protection against unauthorized access.

For more best practices on Magento configuration and customization, don’t forget to check out the resources at LaravelCompany.com. They provide comprehensive guides and tutorials to help you optimize your e-commerce platform effectively.

Magento 1 Themes Configuration Customers

Our network