Get Free Audit

Magento Tips: How to Validate Forms In Magento

Jul 22, 2013

3347 Aliaksandr Simonchik

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.

Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

2 Comments

Post a new comment

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