franzneves Posted April 22, 2015 Share Posted April 22, 2015 (edited) How do I validate all customer records fields or create masks for all these fields? In Pretashop 1.6. Edited April 22, 2015 by franzneves (see edit history) Link to comment Share on other sites More sharing options...
electriz Posted April 23, 2015 Share Posted April 23, 2015 Where do you want to validate it? In registration form, custom module or somewhere else? Link to comment Share on other sites More sharing options...
franzneves Posted April 23, 2015 Author Share Posted April 23, 2015 The method more easier. Thank you. Link to comment Share on other sites More sharing options...
jgamio Posted April 23, 2015 Share Posted April 23, 2015 1) for example If you look your tpl you find some like these <input class="is_required validate account_input form-control" type="password" data-validate="isPasswd" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" /> look close class="is_required validate account_input form-control" data-validate="isPasswd" go to prestashop/js/validate.js you look function validate_isPasswd(s) { return (s.length >= 5 && s.length < 255); } these check for example lenght you can change the values or add your own functions 2 ) You can use html to fix the lenght for example for the phone not more to 10 put inside the input maxlength="9" you can do another things but depen on what do you want to do Link to comment Share on other sites More sharing options...
electriz Posted April 24, 2015 Share Posted April 24, 2015 You're right, but it's only front-end validation. For more safety I would recommend validating vields also in the controller. Link to comment Share on other sites More sharing options...
franzneves Posted April 24, 2015 Author Share Posted April 24, 2015 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now