Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_len poorly worded #60

Closed
rwitchell opened this issue Nov 23, 2014 · 1 comment
Closed

max_len poorly worded #60

rwitchell opened this issue Nov 23, 2014 · 1 comment

Comments

@rwitchell
Copy link
Contributor

I feel the max_len needs to be re-written in the master version.
For example, a postcode is 4 digits, max_len,4
The output is: The postcode field needs to be shorter than 4 characters.
Which is incorrect, it needs to be 4 or less characters.

Either, the wording needs to change to "field needs to be $param or shorter in length"
or you need to increase the $param by one, as shown below.

case 'validate_max_len':
    $param++;
    if($param == 1) {
        $resp[] = "The <span class=\"$field_class\">$field</span> field needs to be shorter than $param character";
    } else {
        $resp[] = "The <span class=\"$field_class\">$field</span> field needs to be shorter than $param characters";
    }
    break;
case 'validate_min_len':
    $param--;
    if($param == 1) {
        $resp[] = "The <span class=\"$field_class\">$field</span> field needs to be longer than $param character";
    } else {
        $resp[] = "The <span class=\"$field_class\">$field</span> field needs to be longer than $param characters";
    }
    break;
@sn
Copy link
Member

sn commented Aug 6, 2015

I've updated this in the master branch, thanks for pointing it out!

@sn sn closed this as completed Aug 6, 2015
sn pushed a commit that referenced this issue Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants