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?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
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 ?>"