Hey @PLF,
Here is a relevant thread from the community that deals with custom validation.
Best,
Hristian
Thanks! Here is how i validate only letter and spaces 🙂
> <script>
>
> lp.jQuery(function($) {
>
> // Config
> var ruleID = 'myCustomRule';
> var field = 'nombre';
> var message = 'Por favor, evita colocar signos en tu Nombre';
>
> var rules = module.lp.form.data.validationRules[field];
>
> $.validator.addMethod(ruleID, function(value, field) {
>
> // Replace this with any expression you like. It should evaluate to true
> // if the field is valid and false if invalid. This example adds a
> // rule that the user must enter 'I accept' exactly into the field.
> var valid = ( /^[a-zA-Z\s]*$/.test(value) );
>
> return valid || (!rules.required && !value);
> }, message);
>
> rules[ruleID] = true;
>
> });
> </script>