Our payment service provider only allow certain input lengths for some fields.

In this case I want to show a inputfield error in the checkout, when the input of the street name is longer than 35 characters for example.

How can I achieve this?


You can add the class validate-length maximum-length-35 in every template where there is an input for the street.

For example, in app/design/frontend/<your-package>/<your-theme>/template/checkout/onepage/billing.phtml, replace :

class="input-text <?php echo $_streetValidationClass ?>"


class="input-text validate-length maximum-length-35 <?php echo $_streetValidationClass ?>"
  • Great, thanks a lot! Do you also know how to translate the given error message? I already change the sentince inside the Mage_Core.csv file. But that does not translate the message. – JGeer Mar 7 '18 at 11:27
  • You shouldn't edit a core file, even if it's a csv file ;). By the way, it's weird that it's not translated with your change...(did you flush the cache, etc) To translate Text length does not satisfy specified text range., I would use a translate.csv file in app/design/frontend/<your-theme>/default/locale/<your-locale>/translate.csv. – Julien Loizelet Mar 7 '18 at 11:35

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.