Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I changed the validation, so it recognizes default, user-defined regular
expressions
  • Loading branch information
gersh committed Nov 29, 2010
1 parent 9f99dac commit 6a3fa1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions views/helpers/validation.php
Expand Up @@ -256,9 +256,9 @@ function __convertRule($rule) {
}
return $regex;
}

return array('rule' => $rule, 'params' => $params);
}
// If not rule is selected handle with a regular expression
return($rule);
}

function __fixWatch($modelName, $fields) {
foreach($fields as $i => $field) {
Expand Down

1 comment on commit 6a3fa1e

@ptica
Copy link

@ptica ptica commented on 6a3fa1e Apr 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware: this change breaks this readme example for me:
/* Custom Rules and Error Handling */

  1. It's up to you to write the custom function and you're free to use Ajax here.
    For example if you had a custom validation rule �myRule� you would define the function like this:
    $.fn.validate.myRule= function(val, params) {
    //do some validation here and return either true or false.
    }

Please sign in to comment.