Get Free Audit

Magento Tips: How to Validate Forms In Magento

Jul 22, 2013

3030 Aleksander Tretjak

Magento Tips: How to Validate Forms In Magento

When developing the administrative part of a module, it is often necessary to limit text field for the number of characters entered. To indicate the maximum length you can use the attribute of the tag input maxlength. Also you can use the rules of the object Validator:


Example:


The rule requires mandatory input and data length from 1 to 10 characters.

If the rule is observed, the following message appears:

Text length does not satisfy specified text range.

Which does not have indication for the allowed text range, therefore, for this filed it is necessary to add a hint indicating the borders.

Vlad Yunusov
Partner With Us Looking for a partner that will help you to grow your business? We are the right company to develop your webstore. Feel free to get in touch with us. We will be happy to discuss your business opportunities and provide you with a Free Quote. Talk to Vlad

2 Comments

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *